Skip to content

Commit

Permalink
add test-ssl cookbook
Browse files Browse the repository at this point in the history
  • Loading branch information
gdbtek committed Nov 8, 2017
1 parent 375bf6c commit e0c0df8
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cookbooks/test-ssl/attributes/default.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash -e

export TEST_SSL_DOWNLOAD_URL='https://github.com/drwetter/testssl.sh/archive/v2.9.5-1.tar.gz'

export TEST_SSL_INSTALL_FOLDER_PATH='/opt/test-ssl'
46 changes: 46 additions & 0 deletions cookbooks/test-ssl/recipes/install.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash -e

function install()
{
umask '0022'

# Clean Up

initializeFolder "${TEST_SSL_INSTALL_FOLDER_PATH}"

# Install

unzipRemoteFile "${TEST_SSL_DOWNLOAD_URL}" "${TEST_SSL_INSTALL_FOLDER_PATH}"
chown -R "$(whoami):$(whoami)" "${TEST_SSL_INSTALL_FOLDER_PATH}"
ln -f -s "${TEST_SSL_INSTALL_FOLDER_PATH}/testssl.sh" '/usr/local/bin/testssl'

# Config Profile

local -r profileConfigData=('__INSTALL_FOLDER_PATH__' "${TEST_SSL_INSTALL_FOLDER_PATH}")

createFileFromTemplate "${APP_FOLDER_PATH}/../templates/test-ssl.sh.profile" '/etc/profile.d/test-ssl.sh' "${profileConfigData[@]}"

# Display Version

displayVersion "$("${TEST_SSL_INSTALL_FOLDER_PATH}/testssl.sh" version)"

umask '0077'
}

function main()
{
APP_FOLDER_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

source "${APP_FOLDER_PATH}/../../../libraries/util.bash"
source "${APP_FOLDER_PATH}/../attributes/default.bash"

checkRequireLinuxSystem
checkRequireRootUser

header 'INSTALLING TEST-SSL'

install
installCleanUp
}

main "${@}"
3 changes: 3 additions & 0 deletions cookbooks/test-ssl/templates/test-ssl.sh.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash -e

export PATH="__INSTALL_FOLDER_PATH__:${PATH}"

0 comments on commit e0c0df8

Please sign in to comment.