1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00
openmptcprouter-feeds/omr-update/files/etc/init.d/omr-update
2018-06-07 21:46:54 +02:00

30 lines
668 B
Bash
Executable file

#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org
START=9
STOP=98
boot() {
. /lib/functions/system.sh
cd /etc/uci-defaults || return 0
files="$(ls)"
[ -n "$files" ] && {
mkdir /usr/share/omr-update
cp /etc/uci-defaults/* /usr/share/omr-update
return 0
}
source /etc/os-release
if [ "$(uci -q get openmptcprouter.settings.version)" != "${VERSION}" ]; then
cd /usr/share/omr-update || return 0
files="$(ls)"
[ -z "$files" ] && return 0
for file in $files; do
( . "./$(basename $file)" )
done
uci -q set openmptcprouter.settings.version=${VERSION}
uci commit
fi
# temporary hack until configd exists
/sbin/reload_config
}