From 40176f40cdfb811ec4b432c10ff0fede65f7044a Mon Sep 17 00:00:00 2001 From: oneseveneight Date: Sun, 16 Sep 2018 06:16:49 +0000 Subject: [PATCH] Revert "Shellchecked scripts, fixed spelling errors" This reverts commit 4a2e1edc54b8d624a659d1ecc7e6e7869921f0c5 --- deluser.sh | 14 +++++++------- login.sh | 4 ++-- lxcinit.sh | 6 +++--- newuser.sh | 12 ++++++------ sendmsg.sh | 8 ++++---- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/deluser.sh b/deluser.sh index 926ada7..3b4e773 100755 --- a/deluser.sh +++ b/deluser.sh @@ -1,15 +1,15 @@ #!/bin/sh SLBRUSER=$1 -test -z "$SLBRUSER" && echo "no user provided" && exit +test -z $SLBRUSER && echo "no user provided" && exit if ps -o stat= -p $PPID | grep -qv S+ #check if this is being called from listen.py then echo "YOU ARE ABOUT TO PERMANENTLY DELETE USER $SLBRUSER AND ALL OF THEIR DATA. RE-ENTER THE USERS NAME TO CONTINUE" - read -r ENTEREDUSER - [ "$ENTEREDUSER" != "$SLBRUSER" ] && echo "users did not match, exiting..." && exit + read ENTEREDUSER + [ $ENTEREDUSER != $SLBRUSER ] && echo "users did not match, exiting..." && exit fi -lxc stop "$SLBRUSER" -lxc delete "$SLBRUSER" -sudo rm -rf "$SLBRUSER" -sudo userdel "$SLBRUSER" +lxc stop $SLBRUSER +lxc delete $SLBRUSER +sudo rm -rf $SLBRUSER +sudo userdel $SLBRUSER tr '\n' ' ' < users | sed "s/$SLBRUSER //" | tr ' ' '\n' > users.temp mv users.temp users diff --git a/login.sh b/login.sh index 80a2968..b4c288b 100755 --- a/login.sh +++ b/login.sh @@ -1,11 +1,11 @@ #!/bin/sh . /etc/profile.d/apps-bin-path.sh echo "The game has not started yet! Grab a cup of tea, or just wait here." -while test -z "$(cat /home/slbr/gamestatus)" || break +while test -z $(cat /home/slbr/gamestatus) || break do printf "." sleep 1 done echo "READY.......BEGIN!" sleep 1 -lxc exec "$(whoami)" /usr/bin/tmuxinit.sh +lxc exec $(whoami) /usr/bin/tmuxinit.sh diff --git a/lxcinit.sh b/lxcinit.sh index 007c2a2..0bb87ad 100755 --- a/lxcinit.sh +++ b/lxcinit.sh @@ -2,6 +2,6 @@ #WARRNING: THIS SHOULD ONLY BE INVOKED FROM newuser.sh echo " Launching container for user $(whoami)" . /etc/profile.d/apps-bin-path.sh \ - && lxc launch ubuntu: "$(whoami)" -lxc file push /home/slbr/tmuxinit.sh "$(whoami)/usr/bin/tmuxinit.sh" -lxc file push /home/slbr/suicidebash.bashrc "$(whoami)/etc/bash.bashrc" + && lxc launch ubuntu: $(whoami) +lxc file push /home/slbr/tmuxinit.sh $(whoami)/usr/bin/tmuxinit.sh +lxc file push /home/slbr/suicidebash.bashrc $(whoami)/etc/bash.bashrc diff --git a/newuser.sh b/newuser.sh index bfbe5a2..bb26684 100755 --- a/newuser.sh +++ b/newuser.sh @@ -1,16 +1,16 @@ #!/bin/sh SLBRUSER=$1 -test -z "$SLBRUSER" && echo "no user provided" && exit +test -z $SLBRUSER && echo "no user provided" && exit echo "Creating homedir..." mkdir "/home/slbr/$SLBRUSER" -echo "$SLBRUSER" >> users +echo $SLBRUSER >> users echo "lxc exec $SLBRUSER bash" > "/home/slbr/$SLBRUSER/.profile" chmod -w "/home/slbr/$SLBRUSER/.profile" echo "Creating user..." -sudo useradd "$SLBRUSER" -d "/home/slbr/$SLBRUSER" -sudo usermod -a -G lxd "$SLBRUSER" +sudo useradd $SLBRUSER -d "/home/slbr/$SLBRUSER" +sudo usermod -a -G lxd $SLBRUSER sudo chown "$SLBRUSER:$SLBRUSER" "/home/slbr/$SLBRUSER" -sudo chsh "$SLBRUSER" -s /home/slbr/login.sh +sudo chsh $SLBRUSER -s /home/slbr/login.sh echo "Creating container..." -sudo su "$SLBRUSER" -s /bin/sh -c "/home/slbr/lxcinit.sh" +sudo su $SLBRUSER -s /bin/sh -c "/home/slbr/lxcinit.sh" diff --git a/sendmsg.sh b/sendmsg.sh index 6320d75..f5685e9 100755 --- a/sendmsg.sh +++ b/sendmsg.sh @@ -1,9 +1,9 @@ #!/bin/bash function send { - ADDRESSES=$(lxc list | cut -f 4 -d '|' \ - | grep -Eo "[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*") - for ADDRESS in $ADDRESSES + ADRESSES=$(lxc list | cut -f 4 -d '|' \ + | grep -Eo "[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*") + for ADRESS in $ADRESSES do - echo "$1" | nc -q2 "$ADDRESS" 9090 + echo $1 | nc -q2 $ADRESS 9090 done }