Fix the trouble with logname
This commit is contained in:
parent
2cb4de353a
commit
2c36212e41
10
attach
10
attach
@ -1,9 +1,15 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
RUNUSER="sudo -u $(logname)"
|
RUNUSER="sudo -u $SUDO_USER"
|
||||||
|
|
||||||
|
if [ -z "$SUDO_USER" ]; then
|
||||||
|
echo This script may not be run without sudo!
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
$RUNUSER bash ./scripts/updater --autoupdater
|
$RUNUSER bash ./scripts/updater --autoupdater
|
||||||
|
|
||||||
line=$(pgrep -u $(logname) hl2_linux)
|
line=$(pgrep -u $SUDO_USER hl2_linux)
|
||||||
arr=($line)
|
arr=($line)
|
||||||
inst=$1
|
inst=$1
|
||||||
if [ $# == 0 ]; then
|
if [ $# == 0 ]; then
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
RUNUSER="sudo -u $(logname)"
|
RUNUSER="sudo -u $SUDO_USER"
|
||||||
|
|
||||||
|
if [ -z "$SUDO_USER" ]; then
|
||||||
|
echo This script may not be run without sudo!
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
$RUNUSER bash ./scripts/updater --autoupdater
|
$RUNUSER bash ./scripts/updater --autoupdater
|
||||||
|
|
||||||
line=$(pgrep -u $SUDO_USER hl2_linux)
|
line=$(pgrep -u $SUDO_USER hl2_linux)
|
||||||
|
@ -3,7 +3,13 @@
|
|||||||
# Thank you LWSS
|
# Thank you LWSS
|
||||||
# https://github.com/LWSS/Fuzion/commit/a53b6c634cde0ed47b08dd587ba40a3806adf3fe
|
# https://github.com/LWSS/Fuzion/commit/a53b6c634cde0ed47b08dd587ba40a3806adf3fe
|
||||||
|
|
||||||
RUNUSER="sudo -u $(logname)"
|
RUNUSER="sudo -u $SUDO_USER"
|
||||||
|
|
||||||
|
if [ -z "$SUDO_USER" ]; then
|
||||||
|
echo This script may not be run without sudo!
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
$RUNUSER bash ./scripts/updater --autoupdater
|
$RUNUSER bash ./scripts/updater --autoupdater
|
||||||
|
|
||||||
line=$(pgrep -u $SUDO_USER hl2_linux)
|
line=$(pgrep -u $SUDO_USER hl2_linux)
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
[[ ! -z "$SUDO_USER" ]] && user=$SUDO_USER || user=$LOGNAME
|
||||||
if ! [ -d "/opt/cathook/data" ]; then
|
if ! [ -d "/opt/cathook/data" ]; then
|
||||||
echo "Creating cathook data directory at /opt/cathook/data"
|
echo "Creating cathook data directory at /opt/cathook/data"
|
||||||
mkdir -p "/opt/cathook/data"
|
mkdir -p "/opt/cathook/data"
|
||||||
chown -R $USER "/opt/cathook/data"
|
chown -R $user "/opt/cathook/data"
|
||||||
chmod -R 777 "/opt/cathook/data"
|
chmod -R 777 "/opt/cathook/data"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing cathook data to /opt/cathook/data"
|
echo "Installing cathook data to /opt/cathook/data"
|
||||||
rsync -avh --progress "data/" "/opt/cathook/data"
|
rsync -avh --progress "data/" "/opt/cathook/data"
|
||||||
rsync -avh --ignore-existing --progress "config_data/" "/opt/cathook/data"
|
rsync -avh --ignore-existing --progress "config_data/" "/opt/cathook/data"
|
||||||
chown -R $(logname) "/opt/cathook/data"
|
chown -R $user "/opt/cathook/data"
|
||||||
chmod -R 777 "/opt/cathook/data"
|
chmod -R 777 "/opt/cathook/data"
|
||||||
|
4
preload
4
preload
@ -4,7 +4,7 @@ if [ $EUID == 0 ]; then
|
|||||||
echo "This script must not be run as root"
|
echo "This script must not be run as root"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
line=$(pgrep -u $(logname) hl2_linux)
|
line=$(pgrep -u $LOGNAME hl2_linux)
|
||||||
arr=($line)
|
arr=($line)
|
||||||
|
|
||||||
if [ ${#arr[@]} != 0 ]; then
|
if [ ${#arr[@]} != 0 ]; then
|
||||||
@ -12,7 +12,7 @@ if [ ${#arr[@]} != 0 ]; then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
line=$(pgrep -u $(logname) steam)
|
line=$(pgrep -u $LOGNAME steam)
|
||||||
arr=($line)
|
arr=($line)
|
||||||
|
|
||||||
if [ ${#arr[@]} == 0 ]; then
|
if [ ${#arr[@]} == 0 ]; then
|
||||||
|
Reference in New Issue
Block a user