Skip to content

Commit e0c0df8

Browse files
committed
add test-ssl cookbook
1 parent 375bf6c commit e0c0df8

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash -e
2+
3+
export TEST_SSL_DOWNLOAD_URL='https://github.com/drwetter/testssl.sh/archive/v2.9.5-1.tar.gz'
4+
5+
export TEST_SSL_INSTALL_FOLDER_PATH='/opt/test-ssl'
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash -e
2+
3+
function install()
4+
{
5+
umask '0022'
6+
7+
# Clean Up
8+
9+
initializeFolder "${TEST_SSL_INSTALL_FOLDER_PATH}"
10+
11+
# Install
12+
13+
unzipRemoteFile "${TEST_SSL_DOWNLOAD_URL}" "${TEST_SSL_INSTALL_FOLDER_PATH}"
14+
chown -R "$(whoami):$(whoami)" "${TEST_SSL_INSTALL_FOLDER_PATH}"
15+
ln -f -s "${TEST_SSL_INSTALL_FOLDER_PATH}/testssl.sh" '/usr/local/bin/testssl'
16+
17+
# Config Profile
18+
19+
local -r profileConfigData=('__INSTALL_FOLDER_PATH__' "${TEST_SSL_INSTALL_FOLDER_PATH}")
20+
21+
createFileFromTemplate "${APP_FOLDER_PATH}/../templates/test-ssl.sh.profile" '/etc/profile.d/test-ssl.sh' "${profileConfigData[@]}"
22+
23+
# Display Version
24+
25+
displayVersion "$("${TEST_SSL_INSTALL_FOLDER_PATH}/testssl.sh" version)"
26+
27+
umask '0077'
28+
}
29+
30+
function main()
31+
{
32+
APP_FOLDER_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
33+
34+
source "${APP_FOLDER_PATH}/../../../libraries/util.bash"
35+
source "${APP_FOLDER_PATH}/../attributes/default.bash"
36+
37+
checkRequireLinuxSystem
38+
checkRequireRootUser
39+
40+
header 'INSTALLING TEST-SSL'
41+
42+
install
43+
installCleanUp
44+
}
45+
46+
main "${@}"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash -e
2+
3+
export PATH="__INSTALL_FOLDER_PATH__:${PATH}"

0 commit comments

Comments
 (0)