commit 05c6a16b16d135e3ef418eb23a36a3fa928683ab Author: Michael De Roover Date: Tue Mar 24 17:44:31 2020 +0100 Modified rb to work without external vars diff --git a/rb b/rb new file mode 100755 index 0000000..f6c2002 --- /dev/null +++ b/rb @@ -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 diff --git a/rbc b/rbc new file mode 100755 index 0000000..99bfe78 --- /dev/null +++ b/rbc @@ -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) diff --git a/rbs b/rbs new file mode 100755 index 0000000..5ca12ff --- /dev/null +++ b/rbs @@ -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)