#!/bin/sh . /etc/functions.sh config_load autoupdate config_get url method url config_get auto method auto config_get branch method branch if enabled $auto || [ "$1" == "manual" ]; then while true; do instversion="$(cat /etc/addon_version)" wget -q -O /tmp/install.sh $url/$branch/$instversion/install.sh 2>/dev/null if [ ! "$?" -eq "0" ]; then exit 0; fi sh /tmp/install.sh if [ "$instversion" == "$(cat /etc/addon_version)" ]; then echo "Update failed!" exit 1 fi done else if [ "$1" != "cron" ]; then echo "Autoupdate is disabled. Try $0 manual" fi fi