Modified rb to work without external vars

This commit is contained in:
Michael De Roover 2020-03-24 17:44:31 +01:00
commit 05c6a16b16
3 changed files with 38 additions and 0 deletions

14
rb Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
# . /usr/local/bin/vars
# Sample setup, change with your own
desk=(thonkpad desktop deskpi controller)
# Restart clients
for i in ${desk[*]:0:3} # 3 clients = first 3 array elements
do
rbc $i
done
# Restart server
rbs ${desk[3]} # server = 4th array element

12
rbc Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
srv="controller" # insert your server's screen name here
bcmd="barrierc -f --no-tray --debug INFO --name $1 --enable-crypto $srv"
ssh $1 killall barrierc
if ssh $1 pidof barrierc &>/dev/null
then
ssh $1 killall -9 barrierc
fi
ssh $1 screen -dmS barrier $bcmd
ssh root@$1 renice -n -20 $(ssh $1 pidof barrierc)

12
rbs Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
srv="controller" # insert your server hostname/ip here
bcmd="barriers -f --no-tray --debug INFO --name $srv --enable-crypto -c /etc/barrier.conf --address :24800"
ssh $1 killall barriers
if ssh $1 pidof -q barriers
then
ssh $1 killall -9 barriers
fi
ssh $1 screen -dmS barrier $bcmd
ssh root@$1 renice -n -20 $(ssh $1 pidof barriers)