Skip to content
Permalink
Browse files

Fix the trouble with logname

  • Loading branch information...
BenCat07 committed Sep 11, 2019
1 parent 2cb4de3 commit 2c36212e412d7574a8d2c7da08729eecfc40113c
Showing with 27 additions and 8 deletions.
  1. +8 −2 attach
  2. +7 −1 attach-gdb
  3. +7 −1 attach-libnamed.sh
  4. +3 −2 install-data
  5. +2 −2 preload
10 attach
@@ -1,9 +1,15 @@
#!/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

line=$(pgrep -u $(logname) hl2_linux)
line=$(pgrep -u $SUDO_USER hl2_linux)
arr=($line)
inst=$1
if [ $# == 0 ]; then
@@ -1,6 +1,12 @@
#!/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

line=$(pgrep -u $SUDO_USER hl2_linux)
@@ -3,7 +3,13 @@
# Thank you LWSS
# 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

line=$(pgrep -u $SUDO_USER hl2_linux)
@@ -1,14 +1,15 @@
#!/usr/bin/env bash

[[ ! -z "$SUDO_USER" ]] && user=$SUDO_USER || user=$LOGNAME
if ! [ -d "/opt/cathook/data" ]; then
echo "Creating cathook data directory at /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"
fi

echo "Installing cathook data to /opt/cathook/data"
rsync -avh --progress "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"
@@ -4,15 +4,15 @@ if [ $EUID == 0 ]; then
echo "This script must not be run as root"
exit
fi
line=$(pgrep -u $(logname) hl2_linux)
line=$(pgrep -u $LOGNAME hl2_linux)
arr=($line)

if [ ${#arr[@]} != 0 ]; then
echo TF2 Already Running!
exit
fi

line=$(pgrep -u $(logname) steam)
line=$(pgrep -u $LOGNAME steam)
arr=($line)

if [ ${#arr[@]} == 0 ]; then

0 comments on commit 2c36212

Please sign in to comment.
You can’t perform that action at this time.