fix: absolute path deleted

This commit is contained in:
Дмитрий Абдрахманов 2024-10-07 10:57:04 +03:00
parent 4f97e1efc3
commit 9f6739b855
3 changed files with 16 additions and 5 deletions

View File

@ -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

View File

@ -1,3 +1,8 @@
#!/bin/bash
/usr/bin/curl localhost:8000 > ./__data__/data.out
SCRIPT=$(readlink -f "$0")
DIR=$(dirname "$SCRIPT")
cd $DIR
mkdir -p ../__data__/
curl localhost:8000 > ../__data__/data.out

View File

@ -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: