Update supernode

This commit is contained in:
stebifan 2016-05-06 10:56:16 +02:00
parent 8b479fa9bf
commit c525ccc8f3

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
help () { help () {
echo "Supernode Settings:" echo "Supernode Settings:"
echo "status | off | loadbalance" echo "status | off | on | loadbalance_on | loadbalance_off | auto"
} }
status () { status () {
@ -36,17 +36,19 @@ on () {
echo "Supernode Aktiviert" echo "Supernode Aktiviert"
} }
loadbalance () { loadbalance_on () {
loadbalancing=$(cat /etc/supernode-status/loadbalancing.mode)
if ! [ -f /etc/supernode-status/loadbalancing.mode ]; then
echo 0 > /etc/supernode-status/loadbalancing.mode
fi
if [ $loadbalancing == 0 ]; then
echo 1 > /etc/supernode-status/loadbalancing.mode echo 1 > /etc/supernode-status/loadbalancing.mode
else echo "Loadbalance on"
}
loadbalance_off () {
echo 0 > /etc/supernode-status/loadbalancing.mode echo 0 > /etc/supernode-status/loadbalancing.mode
fi echo "Loadbalance off"
sleep 5 }
status
auto () {
echo 1 > /etc/supernode-status/loadbalancing.mode
echo 1 > /etc/supernode-status/supernode.mode
echo "Supernode Aktiviert inkl. Loadbalance"
} }
$1 $1