diff --git a/2-install-guacamole.sh b/2-install-guacamole.sh index a737514..d070eaf 100644 --- a/2-install-guacamole.sh +++ b/2-install-guacamole.sh @@ -78,7 +78,7 @@ if [ $? -ne 0 ]; then else echo -e "${LGREEN}OK${GREY}" fi -service postfix restart +systemctl restart postfix # Download Guacamole Server echo @@ -330,7 +330,7 @@ fi # Restart Tomcat echo -e "${GREY}Restarting Tomcat service & enable at boot..." -service ${TOMCAT_VERSION} restart +systemctl restart ${TOMCAT_VERSION} if [ $? -ne 0 ]; then echo -e "${LRED}Failed${GREY}" 1>&2 exit 1 @@ -349,7 +349,7 @@ if [ "${INSTALL_MYSQL}" = true ]; then echo -e "${GREY}Restarting MySQL service & enable at boot..." # Set MySQl to start at boot systemctl enable mysql - service mysql restart + systemctl restart mysql if [ $? -ne 0 ]; then echo -e "${LRED}Failed${GREY}" 1>&2 exit 1 @@ -390,7 +390,7 @@ else mysql_tzinfo_to_sql /usr/share/zoneinfo 2>/dev/null | mysql -u root -D mysql -h ${MYSQL_HOST} -P ${MYSQL_PORT} crudini --set ${mysqlconfig} mysqld default_time_zone "${timezone}" # Restart to apply - service mysql restart + systemctl restart mysql fi fi if [ $? -ne 0 ]; then @@ -481,8 +481,8 @@ fi # Ensure guacd is started echo -e "${GREY}Starting guacd service & enable at boot..." systemctl enable guacd -service guacd stop 2>/dev/null -service guacd start +systemctl stop guacd 2>/dev/null +systemctl start guacd if [ $? -ne 0 ]; then echo -e "${LRED}Failed. See ${LOG_LOCATION}${GREY}" 1>&2 exit 1 @@ -539,10 +539,10 @@ fi if [ "${CHANGE_ROOT}" = true ]; then echo -e "${GREY}Setting default Guacamole url to http root...${DGREY}" -sudo systemctl stop ${TOMCAT_VERSION} -sudo rm -rf /var/lib/${TOMCAT_VERSION}/webapps/ROOT -sudo mv /var/lib/${TOMCAT_VERSION}/webapps/guacamole.war /var/lib/${TOMCAT_VERSION}/webapps/ROOT.war -sudo systemctl start ${TOMCAT_VERSION} +systemctl stop ${TOMCAT_VERSION} +rm -rf /var/lib/${TOMCAT_VERSION}/webapps/ROOT +mv /var/lib/${TOMCAT_VERSION}/webapps/guacamole.war /var/lib/${TOMCAT_VERSION}/webapps/ROOT.war +systemctl start ${TOMCAT_VERSION} if [ $? -ne 0 ]; then echo -e "${LRED}Failed. See ${LOG_LOCATION}${GREY}" 1>&2 exit 1 diff --git a/4b-install-ssl-letsencrypt-nginx.sh b/4b-install-ssl-letsencrypt-nginx.sh index e0013de..cebfbe8 100644 --- a/4b-install-ssl-letsencrypt-nginx.sh +++ b/4b-install-ssl-letsencrypt-nginx.sh @@ -151,7 +151,7 @@ sed -i '/# certbot renew/d' cron_1 # Randomly choose a daily update schedule and append this to the cron schedule HOUR=$(shuf -i 0-23 -n 1) MINUTE=$(shuf -i 0-59 -n 1) -echo "${MINUTE} ${HOUR} * * * /usr/bin/certbot renew --quiet --pre-hook 'service nginx stop' --post-hook 'service nginx start'" >>cron_1 +echo "${MINUTE} ${HOUR} * * * /usr/bin/certbot renew --quiet --pre-hook 'systemctl stop nginx' --post-hook 'systemctl start nginx'" >>cron_1 # Overwrite old cron settings and cleanup crontab cron_1 rm cron_1 diff --git a/add-smtp-relay-o365.sh b/add-smtp-relay-o365.sh index 171f7d6..185d12f 100644 --- a/add-smtp-relay-o365.sh +++ b/add-smtp-relay-o365.sh @@ -108,7 +108,7 @@ sudo postmap /etc/postfix/generic # Restart and test echo -e "${GREY}Restarting Postfix..." -sudo service postfix restart +sudo systemctl restart postfix if [ $? -ne 0 ]; then echo -e "${LRED}Postfix restart failed. ${GREY}" 1>&2 exit 1