You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
548 B
23 lines
548 B
function hybrid_ifup() {
|
|
hybrid=$(/bin/bash /data/appl/ok/swarmlab-hybrid-agent/src-local/hybrid/connect/status.sh wg0 | jq .hybrid)
|
|
tempswarm1="${hybrid%\"}"
|
|
tempswarm1="${tempswarm1#\"}"
|
|
hybrid=$tempswarm1
|
|
echo $hybrid
|
|
}
|
|
|
|
hybrid=$(hybrid_ifup)
|
|
if [ $hybrid == 'NotOnline' ]; then
|
|
echo "Swarmlab hybrid $hybrid"
|
|
else
|
|
ip link set wg0 down
|
|
ip link del wg0
|
|
sleep 3
|
|
hybrid1=$(hybrid_ifup)
|
|
if [ $hybrid1 == 'NotOnline' ]; then
|
|
echo "Swarmlab hybrid $hybrid"
|
|
else
|
|
echo "Swarmlab hybrid $hybrid"
|
|
fi
|
|
fi
|
|
|
|
|