Several new features
- cht.sh stack : linux online cheatsheet. Usage : `cheat <command>`. Example for tar : `cheat tar` - ClamAV anti-virus with weekly cronjob to update signatures database - Internal function to add daily cronjobs - Additional comment to detect previous configuration tuning (MariaDB & Redis) - Domain/Subdomain detection based on public domain suffixes list - Increase Nginx & MariaDB systemd open_files limits - Cronjob to update Cloudflare IPs list
This commit is contained in:
@@ -17,8 +17,12 @@ class WOService():
|
||||
"""
|
||||
try:
|
||||
if service_name in ['nginx', 'php5-fpm']:
|
||||
service_cmd = ('{0} -t && service {0} start'
|
||||
.format(service_name))
|
||||
# Check Nginx configuration before executing command
|
||||
sub = subprocess.Popen('nginx -t', stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, shell=True)
|
||||
output, error_output = sub.communicate()
|
||||
if 'emerg' not in str(error_output):
|
||||
service_cmd = ('service {0} start'.format(service_name))
|
||||
else:
|
||||
service_cmd = ('service {0} start'.format(service_name))
|
||||
|
||||
@@ -64,8 +68,12 @@ class WOService():
|
||||
"""
|
||||
try:
|
||||
if service_name in ['nginx', 'php5-fpm']:
|
||||
service_cmd = ('{0} -t && service {0} restart'
|
||||
.format(service_name))
|
||||
# Check Nginx configuration before executing command
|
||||
sub = subprocess.Popen('nginx -t', stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, shell=True)
|
||||
output, error_output = sub.communicate()
|
||||
if 'emerg' not in str(error_output):
|
||||
service_cmd = ('service {0} restart'.format(service_name))
|
||||
else:
|
||||
service_cmd = ('service {0} restart'.format(service_name))
|
||||
|
||||
@@ -90,8 +98,12 @@ class WOService():
|
||||
"""
|
||||
try:
|
||||
if service_name in ['nginx', 'php5-fpm']:
|
||||
service_cmd = ('{0} -t && service {0} reload'
|
||||
.format(service_name))
|
||||
# Check Nginx configuration before executing command
|
||||
sub = subprocess.Popen('nginx -t', stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, shell=True)
|
||||
output, error_output = sub.communicate()
|
||||
if 'emerg' not in str(error_output):
|
||||
service_cmd = ('service {0} restart'.format(service_name))
|
||||
else:
|
||||
service_cmd = ('service {0} reload'.format(service_name))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user