Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Geek-MD authored Jul 25, 2023
1 parent 18921b1 commit e7dd436
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions asu-notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def get_config():
apple_url = data['apple_url']
return prog_name_short, prog_name_long, version, apple_url

def create_service_file(working_dir, pythonpath, progname):
def create_service_file(working_dir, python_path, prog_name):
service_str = f"""[Unit]
Description={progname}
Description={prog_name}
After=multi-user.target
[Service]
Expand All @@ -38,7 +38,7 @@ def create_service_file(working_dir, pythonpath, progname):
RestartSec=30s
KillMode=process
TimeoutSec=infinity
Environment="PYTHONPATH=$PYTHONPATH:{pythonpath}/"
Environment="PYTHONPATH=$PYTHONPATH:{python_path}/"
[Install]
WantedBy=multi-user.target"""
Expand Down Expand Up @@ -209,7 +209,7 @@ def main():

prog_name_short, prog_name_long, version, apple_url = get_config()
bot_token, timezone, chat_ids = argument_parser(prog_name_short, prog_name_long, version)
create_service_file(python_path, working_dir, prog_name_long)
create_service_file(working_dir, python_path, prog_name_long)
create_config_json(apple_url, prog_name_short, bot_token, chat_ids, timezone)
subprocess.run(f'{working_dir}/asu-notifier.sh')

Expand Down

0 comments on commit e7dd436

Please sign in to comment.