Compare commits
2 commits
a0fce4f7b6
...
d9303437a9
| Author | SHA1 | Date | |
|---|---|---|---|
| d9303437a9 | |||
| 3b8667ee1c |
3 changed files with 38 additions and 1 deletions
33
scripts/check_mod_md.py
Normal file
33
scripts/check_mod_md.py
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
from pastafariutils import linux
|
||||||
|
import distro
|
||||||
|
import argparse
|
||||||
|
from pathlib import Path
|
||||||
|
import os, sys
|
||||||
|
|
||||||
|
|
||||||
|
parser=argparse.ArgumentParser(prog='manage_apache.py', description='A tool for admin an apache server')
|
||||||
|
|
||||||
|
parser.add_argument("--set_reload_apache", action='store_true')
|
||||||
|
|
||||||
|
args=parser.parse_args()
|
||||||
|
|
||||||
|
tmp_file='/tmp/reload_apache_file'
|
||||||
|
|
||||||
|
if args.set_reload_apache:
|
||||||
|
Path(tmp_file).touch()
|
||||||
|
else:
|
||||||
|
if os.path.isfile(tmp_file):
|
||||||
|
|
||||||
|
print('Reloading apache because is neccesary for mod_md from apache...')
|
||||||
|
|
||||||
|
linux_service={'debian' : 'apache2', 'ubuntu' : 'apache2', 'fedora' : 'httpd', 'almalinux' : 'httpd', 'rocky' : 'httpd', 'arch' : 'httpd', 'gentoo': 'apache2'}
|
||||||
|
|
||||||
|
if linux.systemd_service('reload', linux_service):
|
||||||
|
|
||||||
|
os.unlink(tmp_file)
|
||||||
|
else:
|
||||||
|
print('Error: cannot reload apache for update mod_md certificates')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -129,6 +129,10 @@ if linux_distro=='rocky' or linux_distro=='almalinux' or linux_distro=='fedora':
|
||||||
else:
|
else:
|
||||||
print('Not firewalld detected...')
|
print('Not firewalld detected...')
|
||||||
|
|
||||||
|
# Copy file
|
||||||
|
|
||||||
|
linux.shell_command('sudo cp modules/apache/scripts/check_mod_md.py /usr/local/bin && sudo chmod 755 /usr/local/bin/check_mod_md.py')
|
||||||
|
|
||||||
#Restart apache
|
#Restart apache
|
||||||
|
|
||||||
linux_service={'debian' : 'apache2', 'ubuntu' : 'apache2', 'fedora' : 'httpd', 'almalinux' : 'httpd', 'rocky' : 'httpd', 'arch' : 'httpd'}
|
linux_service={'debian' : 'apache2', 'ubuntu' : 'apache2', 'fedora' : 'httpd', 'almalinux' : 'httpd', 'rocky' : 'httpd', 'arch' : 'httpd'}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class ServerTask(Task):
|
||||||
|
|
||||||
#['modules/webservers/scripts/install_quota_home.py', 0o700],
|
#['modules/webservers/scripts/install_quota_home.py', 0o700],
|
||||||
|
|
||||||
self.files=[['modules/apache/scripts/install_apache.py', 0o700]]
|
self.files=[['modules/apache/scripts/install_apache.py', 0o700], ['modules/apache/scripts/check_mod_md.py', 0o700]]
|
||||||
|
|
||||||
#self.commands_to_execute=[]
|
#self.commands_to_execute=[]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue