mirror of
https://github.com/iio612/DEFENDER.git
synced 2026-02-13 19:24:23 +00:00
fix Installation
This commit is contained in:
@@ -182,11 +182,7 @@ class Install:
|
|||||||
print(f'/!\\ Service file already exist /!\\')
|
print(f'/!\\ Service file already exist /!\\')
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Check if user systemd is available (.config/systemd/user/)
|
contain = f'''[Unit]
|
||||||
if not os.path.exists(self.config.unix_systemd_folder):
|
|
||||||
self.run_subprocess(['mkdir', '-p', self.config.unix_systemd_folder])
|
|
||||||
|
|
||||||
contain = f'''[Unit]
|
|
||||||
Description=Defender IRC Service
|
Description=Defender IRC Service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
@@ -197,7 +193,19 @@ Restart=on-failure
|
|||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
'''
|
'''
|
||||||
|
# Check if user systemd is available (.config/systemd/user/)
|
||||||
|
if not os.path.exists(self.config.unix_systemd_folder):
|
||||||
|
self.run_subprocess(['mkdir', '-p', self.config.unix_systemd_folder])
|
||||||
|
|
||||||
|
with open(full_service_file_path, 'w+') as servicefile:
|
||||||
|
servicefile.write(contain)
|
||||||
|
servicefile.close()
|
||||||
|
print(f'Service file generated with current configuration')
|
||||||
|
print(f'Running Defender IRC Service ...')
|
||||||
|
self.run_subprocess(self.config.service_cmd_executable)
|
||||||
|
|
||||||
|
else:
|
||||||
with open(full_service_file_path, 'w+') as servicefile:
|
with open(full_service_file_path, 'w+') as servicefile:
|
||||||
servicefile.write(contain)
|
servicefile.write(contain)
|
||||||
servicefile.close()
|
servicefile.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user