diff options
-rwxr-xr-x | share/hydra/import-certs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/share/hydra/import-certs b/share/hydra/import-certs index 74f8d21..0349986 100755 --- a/share/hydra/import-certs +++ b/share/hydra/import-certs @@ -20,8 +20,10 @@ source $APP_BASE/lib/hydra/functions || exit 1 hydra_config_load -# Command line arguments +# Parameters NODES="$*" +PRIVATE="/etc/ssl/private" +SERVICES="apache2 postfix dovecot nginx lighttpd mumble" # Build node list if [ -z "$NODES" ]; then @@ -84,18 +86,16 @@ EOF fi # Concatenated cert - cd /etc/ssl/private - sudo touch $prefix-concat.pem - sudo chown root.ssl-cert $prefix-concat.pem - sudo chmod 640 $prefix-concat.pem - sudo cp /etc/ssl/certs/$cert $prefix-concat.pem - sudo cat $priv | sudo tee -a $prefix-concat.pem > /dev/null + sudo touch $PRIVATE/$prefix-concat.pem + sudo chown root.ssl-cert $PRIVATE/$prefix-concat.pem + sudo chmod 640 $PRIVATE/$prefix-concat.pem + sudo cp /etc/ssl/certs/$cert $PRIVATE/$prefix-concat.pem + sudo cat $PRIVATE/$priv | sudo tee -a $PRIVATE/$prefix-concat.pem > /dev/null # Restart services - services="apache2 postfix nginx lighttpd mumble" - for service in \$services; do - if systemctl list-units | grep active | grep -q $service'.service'; then - sudo service $service restart + for service in $SERVICES; do + if systemctl list-units | grep active | grep -q \$service'.service'; then + sudo service \$service restart fi done EOF |