diff --git a/omr-update/Makefile b/omr-update/Makefile new file mode 100644 index 000000000..a7f509da6 --- /dev/null +++ b/omr-update/Makefile @@ -0,0 +1,34 @@ +# +# Copyright (C) 2018 Ycarus (Yannick Chabanois) +# +# This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=omr-update +PKG_VERSION:=0.1 +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/$(PKG_NAME) + SECTION:=OMR + CATEGORY:=OpenMPTCProuter + TITLE:=OpenMPTCProuter updater + PKGARCH:=all +endef + +define Package/$(PKG_NAME)/description + A module to update OpenMPTCProuter config +endef + +define Build/Compile +endef + +define Package/$(PKG_NAME)/install + $(CP) ./files/* $(1)/ +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/omr-update/files/etc/init.d/omr-update b/omr-update/files/etc/init.d/omr-update new file mode 100755 index 000000000..3c8f7944e --- /dev/null +++ b/omr-update/files/etc/init.d/omr-update @@ -0,0 +1,28 @@ +#!/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 + } + + cd /usr/share/omr-update || return 0 + files="$(ls)" + [ -z "$files" ] && return 0 + for file in $files; do + ( . "./$(basename $file)" ) + done + uci commit + + # temporary hack until configd exists + /sbin/reload_config +}