Revert "Shellchecked scripts, fixed spelling errors"
This reverts commit 4a2e1edc54
This commit is contained in:
parent
4a2e1edc54
commit
40176f40cd
14
deluser.sh
14
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
|
||||
|
|
4
login.sh
4
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
|
||||
|
|
|
@ -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
|
||||
|
|
12
newuser.sh
12
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"
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue