This commit is contained in:
sneakers-the-rat 2022-10-31 18:55:19 -07:00
parent 13ff1774a7
commit b18a7e69d1

View file

@ -48,11 +48,16 @@ class Service:
service = SERVICE_TEMPLATE.format( service = SERVICE_TEMPLATE.format(
**asdict(self) **asdict(self)
) )
try:
with open('/etc/systemd/system/wikibot.service', 'w') as sfile: with open('/etc/systemd/system/wikibot.service', 'w') as sfile:
sfile.write(service) sfile.write(service)
print('System file created, you should now enable it with \nsystemctl enable wikibot\nand start it with\nsystemctl start wikibot') print('System file created, you should now enable it with \nsystemctl enable wikibot\nand start it with\nsystemctl start wikibot')
except PermissionError:
print('Could not write to system file, copy the following service file to /etc/systemd/system/wikibot.service')
print(service)
def main(): def main():
parser = argparser() parser = argparser()
args = parser.parse_args() args = parser.parse_args()