2016-04-17 21:12:28 +00:00
|
|
|
#!/bin/bash
|
|
|
|
help () {
|
|
|
|
echo "Supernode Settings:"
|
2016-05-06 10:11:44 +00:00
|
|
|
echo "status | off | on | auto"
|
2016-04-17 21:12:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
status () {
|
|
|
|
supernode_status=$(/bin/cat /etc/supernode-status/supernode.status)
|
|
|
|
supernode_mode=$(/bin/cat /etc/supernode-status/supernode.mode)
|
|
|
|
loadbalancing=$(cat /etc/supernode-status/loadbalancing.mode)
|
|
|
|
|
|
|
|
echo "Supernode Status: (Ist-Zustand)"
|
|
|
|
if [ $supernode_status == 0 ]; then
|
|
|
|
echo "Supernode ist Offline"
|
|
|
|
elif [ $supernode_status == 1 ]; then
|
|
|
|
echo "Supernode läuft (Loadbalancing)"
|
|
|
|
elif [ $supernode_status == 2 ]; then
|
|
|
|
echo "Supernode läuft (Dauer-Ein)"
|
|
|
|
elif [ $supernode_status == 3 ]; then
|
|
|
|
echo "Supernode Offline (Loadbalancing)"
|
|
|
|
fi
|
|
|
|
if [ $loadbalancing = 1 ]; then
|
|
|
|
echo "Loadbalancing ist Aktiv"
|
|
|
|
else
|
|
|
|
echo "Loadbalancing ist Deativiert"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
off () {
|
|
|
|
echo 0 > /etc/supernode-status/supernode.mode
|
2016-05-06 10:11:44 +00:00
|
|
|
echo 0 > /etc/supernode-status/loadbalancing.mode
|
|
|
|
|
|
|
|
echo "Supernode Aus"
|
2016-04-17 21:12:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
on () {
|
|
|
|
echo 1 > /etc/supernode-status/supernode.mode
|
2016-05-06 08:56:16 +00:00
|
|
|
echo 0 > /etc/supernode-status/loadbalancing.mode
|
2016-05-06 10:11:44 +00:00
|
|
|
echo "Supernode Dauer-An"
|
2016-05-06 08:56:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
auto () {
|
|
|
|
echo 1 > /etc/supernode-status/loadbalancing.mode
|
|
|
|
echo 1 > /etc/supernode-status/supernode.mode
|
|
|
|
echo "Supernode Aktiviert inkl. Loadbalance"
|
2016-04-17 21:12:28 +00:00
|
|
|
}
|
|
|
|
$1
|