#!/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)