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
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