| Server IP : 104.21.95.231 / Your IP : 162.159.114.31 Web Server : Apache System : Linux vm3310.eosdns.net 4.18.0-553.132.1.el8_10.x86_64 #1 SMP Thu Jun 11 14:27:43 UTC 2026 x86_64 User : carnalmedia ( 1000) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /mojo/ |
Upload File : |
#!/bin/bash
#
# Script: restart_services
#
# Usage: restart_services
#
# Description: A script used to restart services that may use Let's Encrypt-generated SSL certificates
#
# Author: Keith Muska
#
# Changelog:
# * 04/28/2017: Keith Muska
# - Initial write
# * 01/08.2020: Keith Muska
# - Previous script was missing an entire code block... It was not stopping the service, only trying to start it. Also, fixed a variable name typo
# * 15.02.2021: Nikita Shchetinin
# - Rewritten completely to make the script more simple and predictible
if [ "$(whoami)" != 'root' ]
then
echo "You must execute this script as the root user!"
exit 1
fi
RESTART () {
if systemctl is-active --quiet httpd
then
systemctl restart httpd
fi
if systemctl is-active --quiet nginx
then
systemctl restart nginx
fi
if systemctl is-active --quiet postfix
then
systemctl restart postfix
fi
if systemctl is-active --quiet dovecot
then
systemctl restart dovecot
fi
if systemctl is-active --quiet vsftpd
then
systemctl restart vsftpd
fi
}
HELP () {
echo "A script used to restart services that may use Let's Encrypt-generated SSL certificates"
echo "usage: restart_services"
}
if [ -z "$1" ]
then
RESTART
else
HELP
fi