Added scripts
This commit is contained in:
parent
bb412f2de0
commit
abd5262630
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
USER=$1
|
||||||
|
lxc stop $USER
|
||||||
|
sudo rm -rf $USER
|
||||||
|
sudo userdel $USER
|
||||||
|
lxc delete $USER
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
nc -l localhost 9191
|
||||||
|
#cat gamelog.txt | nc -q2 10.161.77.78 9090
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
. /etc/profile.d/apps-bin-path.sh
|
||||||
|
lxc exec $(whoami) /usr/bin/tmuxinit.sh
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#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
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/sh
|
||||||
|
USER=$1
|
||||||
|
|
||||||
|
echo "Creating homedir..."
|
||||||
|
mkdir "/home/slbr/$USER"
|
||||||
|
echo "lxc exec $USER bash" > "/home/slbr/$USER/.profile"
|
||||||
|
chmod -w "/home/slbr/$USER/.profile"
|
||||||
|
echo "Creating user..."
|
||||||
|
sudo useradd $USER -d "/home/slbr/$USER"
|
||||||
|
sudo usermod -a -G lxd $USER
|
||||||
|
sudo chown "$USER:$USER" "/home/slbr/$USER"
|
||||||
|
sudo chsh $USER -s /home/slbr/login.sh
|
||||||
|
echo "Creating container..."
|
||||||
|
sudo su $USER -s /bin/sh -c "/home/slbr/lxcinit.sh"
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
function send {
|
||||||
|
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 $ADRESS 9090
|
||||||
|
done
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/sh
|
||||||
|
CNFHANDLE="function command_not_found_handle { echo Wrong; }"
|
||||||
|
tmux new-session -d -n test
|
||||||
|
tmux select-window -t 0:0
|
||||||
|
tmux send -t 0:0 'nc -lkp 9090' ENTER
|
||||||
|
tmux split-window -h bash
|
||||||
|
tmux send -t 0:1 $CNFHANDLE ENTER
|
||||||
|
tmux select-layout
|
||||||
|
tmux resize-pane -t 1 -L 60
|
||||||
|
tmux a
|
Loading…
Reference in New Issue