crime to Level
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user