fix Installation

This commit is contained in:
adator
2024-08-29 01:36:12 +02:00
parent ab15cce82b
commit 6142b4257f

View File

@@ -182,10 +182,6 @@ class Install:
print(f'/!\\ Service file already exist /!\\')
return None
# 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])
contain = f'''[Unit]
Description=Defender IRC Service
@@ -197,7 +193,19 @@ Restart=on-failure
[Install]
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:
servicefile.write(contain)
servicefile.close()