Change to user service files

This commit is contained in:
Marco Cawthorne 2023-11-18 16:07:09 -08:00
parent 2123ee319b
commit 0207013b81
Signed by: eukara
GPG key ID: CE2032F0A2882A22
7 changed files with 32 additions and 31 deletions

View file

@ -5,5 +5,5 @@ systemctl disable freehl
find ./ -type f -name "server.cfg" -print | while read LINE
do
GAMEDIR=$(dirname "$LINE" | cut -d '/' -f 2)
echo systemctl disable freehl@$GAMEDIR
systemctl --user disable freehl@$GAMEDIR
done

View file

@ -1,4 +1,9 @@
#!/bin/sh
systemctl enable freehl
systemctl enable freehl@
systemctl --user enable freehl
find ./ -type f -name "server.cfg" -print | while read LINE
do
GAMEDIR=$(dirname "$LINE" | cut -d '/' -f 2)
systemctl --user enable freehl@$GAMEDIR
done

View file

@ -6,17 +6,9 @@ ExecReload=/bin/kill $MAINPID
KillMode=process
Restart=on-failure
; You want to adjust these for your user, this example assumes debian
User=debian
Environment="HOME=/home/debian"
WorkingDirectory=/home/debian/halflife/
ExecStart=/home/debian/halflife/fteqw-sv64 -halflife
PrivateTmp=true
ProtectHome=false
ProtectSystem=full
PrivateDevices=false
CapabilityBoundingSet=~CAP_SYS_ADMIN
; You want to adjust these for your setup
WorkingDirectory=%h/halflife/
ExecStart=%h/halflife/fteqw-sv64 -halflife
[Install]
WantedBy=multi-user.target
WantedBy=default.target

View file

@ -6,17 +6,9 @@ ExecReload=/bin/kill $MAINPID
KillMode=process
Restart=on-failure
; You want to adjust these for your user, this example assumes debian
User=debian
Environment="HOME=/home/debian"
WorkingDirectory=/home/debian/halflife/
ExecStart=/home/debian/halflife/fteqw-sv64 -halflife -game %i
PrivateTmp=true
ProtectHome=false
ProtectSystem=full
PrivateDevices=false
CapabilityBoundingSet=~CAP_SYS_ADMIN
; You want to adjust these for your setup
WorkingDirectory=%h/halflife/
ExecStart=%h/halflife/fteqw-sv64 -halflife -game %i
[Install]
WantedBy=multi-user.target
WantedBy=default.target

View file

@ -1,6 +1,6 @@
#!/bin/sh
SERVICE_DIR="/etc/systemd/system"
SERVICE_DIR="/etc/systemd/user"
find ./ -type f -name '*.service' -print | while read LINE
do

View file

@ -1,10 +1,9 @@
#!/bin/sh
systemctl restart freehl
systemctl --user restart freehl
find ./ -type f -name "server.cfg" -print | while read LINE
do
GAMEDIR=$(dirname "$LINE" | cut -d '/' -f 2)
echo systemctl restart freehl@$GAMEDIR
##systemctl restart "$FILE"
systemctl --user restart freehl@$GAMEDIR
done

13
stop-services.sh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
systemctl --user restart freehl
find ./ -type f -name "server.cfg" -print | while read LINE
do
GAMEDIR=$(dirname "$LINE" | cut -d '/' -f 2)
if [ "$GAMEDIR" != "valve" ]
then
systemctl --user restart freehl@$GAMEDIR
fi
done