diff --git a/scripts/install.sh b/scripts/install.sh index 693a447..2f5aa26 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,7 +1,11 @@ #!/bin/bash +SCRIPT=$(readlink -f "$0") +DIR=$(dirname "$SCRIPT") + # Update daemon files -/usr/bin/cp -ur $DIR/services/* ~/.config/systemd/user +cd $DIR +cp -ur ../services/* ~/.config/systemd/user # Daemon launch /usr/bin/systemctl --user daemon-reload diff --git a/scripts/main.sh b/scripts/main.sh index 27291ad..5ff15a9 100755 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -1,3 +1,8 @@ #!/bin/bash -/usr/bin/curl localhost:8000 > ./__data__/data.out \ No newline at end of file +SCRIPT=$(readlink -f "$0") +DIR=$(dirname "$SCRIPT") + +cd $DIR +mkdir -p ../__data__/ +curl localhost:8000 > ../__data__/data.out \ No newline at end of file diff --git a/src/installer.py b/src/installer.py index 97fceb1..1ecb16b 100644 --- a/src/installer.py +++ b/src/installer.py @@ -3,15 +3,17 @@ import subprocess import os from time import sleep from server import weather_run +from pathlib import Path -def install(parsed): +def install(parsed) -> None: args = parsed.parse_args() if args.install: - projectDir = "/home/citrullux/ModernOSLabs" + projectDir = str(Path(__file__).resolve().parent.parent) + homeDir = os.getenv("HOME") delivered = filecmp.cmp( projectDir + "/services/wthrc.service", - "/home/citrullux/.config/systemd/user/wthrc.service", + homeDir + "/.config/systemd/user/wthrc.service", shallow=True, ) if not delivered: