mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add omr-update to update old saved config
This commit is contained in:
parent
05b516fd5f
commit
19a321c2fe
2 changed files with 62 additions and 0 deletions
34
omr-update/Makefile
Normal file
34
omr-update/Makefile
Normal file
|
@ -0,0 +1,34 @@
|
|||
#
|
||||
# Copyright (C) 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
#
|
||||
# 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)))
|
28
omr-update/files/etc/init.d/omr-update
Executable file
28
omr-update/files/etc/init.d/omr-update
Executable file
|
@ -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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue