add launch.sh to run it periodically

This commit is contained in:
2026-02-11 07:07:00 +00:00
parent f3c428a819
commit cb372a0193
2 changed files with 11 additions and 6 deletions

View File

@@ -8,12 +8,9 @@ STEAM_KEY=<ur-steam-key-api>
STEAM_USERID64=<<ur-userid>>
```
Run it with cron job
Launch it
```shell
crontab -e
```
```shell
*/30 * * * * /bin/bash -c 'set -a; source $HOME/autorun-steam-game/.env; set +a; exec $HOME/autorun-steam-game/run.sh' >> $HOME/autorun-steam-game/out.log 2>&1
chmod +x ./launch.sh
./launch.sh 30 # in minutes
```

8
launch.sh Normal file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
DELAY=$( [[ -n $1 && $1 =~ ^-?[0-9]+$ ]] && echo "$1" || echo 1 )
while true; do
sleep $(($DELAY * 60))
bash "./run.sh"
done