Fix cathook GUI stuff for the logname changes

This commit is contained in:
BenCat07 2019-09-11 17:23:05 +02:00
parent 2c36212e41
commit 9a2890fb2f
4 changed files with 14 additions and 25 deletions

12
attach
View File

@ -1,15 +1,11 @@
#!/usr/bin/env bash
RUNUSER="sudo -u $SUDO_USER"
[[ ! -z "$SUDO_USER" ]] && RUNUSER="$SUDO_USER" || RUNUSER="$LOGNAME"
RUNCMD="sudo -u $RUNUSER"
if [ -z "$SUDO_USER" ]; then
echo This script may not be run without sudo!
exit
fi
$RUNCMD bash ./scripts/updater --autoupdater
$RUNUSER bash ./scripts/updater --autoupdater
line=$(pgrep -u $SUDO_USER hl2_linux)
line=$(pgrep -u $RUNUSER hl2_linux)
arr=($line)
inst=$1
if [ $# == 0 ]; then

View File

@ -1,15 +1,11 @@
#!/usr/bin/env bash
RUNUSER="sudo -u $SUDO_USER"
[[ ! -z "$SUDO_USER" ]] && RUNUSER="$SUDO_USER" || RUNUSER="$LOGNAME"
RUNCMD="sudo -u $RUNUSER"
if [ -z "$SUDO_USER" ]; then
echo This script may not be run without sudo!
exit
fi
$RUNCMD bash ./scripts/updater --autoupdater
$RUNUSER bash ./scripts/updater --autoupdater
line=$(pgrep -u $SUDO_USER hl2_linux)
line=$(pgrep -u $RUNUSER hl2_linux)
arr=($line)
inst=$1
if [ $# == 0 ]; then

View File

@ -3,14 +3,10 @@
# Thank you LWSS
# https://github.com/LWSS/Fuzion/commit/a53b6c634cde0ed47b08dd587ba40a3806adf3fe
RUNUSER="sudo -u $SUDO_USER"
[[ ! -z "$SUDO_USER" ]] && RUNUSER="$SUDO_USER" || RUNUSER="$LOGNAME"
RUNCMD="sudo -u $RUNUSER"
if [ -z "$SUDO_USER" ]; then
echo This script may not be run without sudo!
exit
fi
$RUNUSER bash ./scripts/updater --autoupdater
$RUNCMD bash ./scripts/updater --autoupdater
line=$(pgrep -u $SUDO_USER hl2_linux)
arr=($line)

View File

@ -4,7 +4,8 @@ if [ $EUID == 0 ]; then
echo "This script must not be run as root"
exit
fi
line=$(pgrep -u $LOGNAME hl2_linux)
[[ ! -z "$SUDO_USER" ]] && RUNUSER=$SUDO_USER || RUNUSER=$LOGNAME
line=$(pgrep -u $RUNUSER hl2_linux)
arr=($line)
if [ ${#arr[@]} != 0 ]; then
@ -12,7 +13,7 @@ if [ ${#arr[@]} != 0 ]; then
exit
fi
line=$(pgrep -u $LOGNAME steam)
line=$(pgrep -u $RUNUSER steam)
arr=($line)
if [ ${#arr[@]} == 0 ]; then