-
Notifications
You must be signed in to change notification settings - Fork 0
/
resteam.sh
executable file
·29 lines (27 loc) · 1.08 KB
/
resteam.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/zsh -
#===============================================================================
#
# FILE: resteam.sh
#
# USAGE: ./resteam.sh
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Cláudio "Patola" Sampaio (Patola), [email protected]
# ORGANIZATION: MakerLinux
# CREATED: 11/29/2020 06:54:25 PM CET
# REVISION: ---
#===============================================================================
set -o nounset # Treat unset variables as an error
ps -ef | grep resteam | grep -v grep | awk -v PR=$$ '($2!=PR) {print $0}' | grep resteam >/dev/null 2>&1 && exit 1
while :
do
sleep 30
ps -ef | grep -v grep | grep -v dumps/assert | grep -v resteam.sh | grep steam > /dev/null 2>&1 || launch /usr/games/steam
z="$(ps -ef | grep -v grep | grep steam | grep -v steamwebhelper | grep -v fossilize_replay | grep -v dumps/assert | sort -n -k 7 | tail -1 | awk '{print $7}')"; [[ "$z" =~ [0-9][0-9]:[0-9][0-9]:[0-9][0-9] && "$z" > "00:10:00" ]] && break
done
exit 0