crime to Level

This commit is contained in:
Tim
2026-01-08 22:00:39 +01:00
parent 26cb36fb35
commit 208ea12661
6 changed files with 66 additions and 66 deletions

View File

@@ -4,5 +4,5 @@ User1: das geht nicht.
User2: Ups das war das falsche.
User2: &Vs@gSfdC+SPh!{BkBSt=~9{
User1: und was war der Username noch mal?
User2: crime2
User2: level2
User1: Perfekt! Danke!

View File

@@ -1,11 +1,11 @@
#!/bin/bash
if [ ! -f /home/crime5/.timer/started ]; then
touch /home/crime5/.timer/started
if [ ! -f /home/level5/.timer/started ]; then
touch /home/level5/.timer/started
nohup python3 /usr/local/bin/systemd-hdtob.py >/tmp/timer.log 2>&1 &
fi
tty > /home/crime5/.timer/current_tty 2>/dev/null || echo "/dev/pts/0" > /home/crime5/.timer/current_tty
chmod 644 /home/crime5/.timer/current_tty
tty > /home/level5/.timer/current_tty 2>/dev/null || echo "/dev/pts/0" > /home/level5/.timer/current_tty
chmod 644 /home/level5/.timer/current_tty
exec /bin/bash

View File

@@ -1,9 +1,9 @@
#!/bin/bash
USER=$(whoami)
if [ "$USER" = "crime5" ]; then
if [ ! -f /home/crime5/.timer/started ]; then
touch /home/crime5/.timer/started
if [ "$USER" = "level5" ]; then
if [ ! -f /home/level5/.timer/started ]; then
touch /home/level5/.timer/started
nohup python3 /usr/local/bin/systemd-hdtob.py >/tmp/timer.log 2>&1 &
fi
fi

View File

@@ -2,8 +2,8 @@ import os
import time
import pwd
STATE_FILE = "/home/crime5/.timer/timer_state.txt"
END_STATE = "/home/crime5/.timer/end_state.txt"
STATE_FILE = "/home/level5/.timer/timer_state.txt"
END_STATE = "/home/level5/.timer/end_state.txt"
def drop_privileges(user):
@@ -21,7 +21,7 @@ def countdown(seconds):
f.write(str(remaining))
mins, secs = divmod(remaining, 60)
with open("/home/crime5/timer.txt", "w") as f:
with open("/home/level5/timer.txt", "w") as f:
f.write(f"{mins:02d}:{secs:02d}")
time.sleep(1)
@@ -36,5 +36,5 @@ def countdown(seconds):
if __name__ == "__main__":
drop_privileges("crime5")
drop_privileges("level5")
countdown(600)