PKG_NAME:=sshtunnel
PKG_VERSION:=3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
include $(INCLUDE_DIR)/package.mk
PKG_NAME:=restorefactory
PKG_VERSION:=1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
include $(INCLUDE_DIR)/package.mk
endef
define Package/restorefactory/install
- $(CP) ./files/* $(1)
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/button
+ $(INSTALL_BIN) ./files/hotplug_restorefactory $(1)/etc/hotplug.d/button/50-restorefactory
+ $(INSTALL_DIR) $(1)/etc/defaults
+ $(INSTALL_BIN) ./files/uci_defaults_restorefactory $(1)/etc/defaults/50-restorefactory
endef
$(eval $(call BuildPackage,restorefactory))
+++ /dev/null
-#!/bin/sh
-
-system_config() {
- config_get button "$1" button "reset"
- config_get action "$1" action "pressed"
- config_get timeout "$1" timeout "5"
-}
-
-config_load system
-config_foreach system_config restorefactory
-
-[ "$BUTTON" = "$button" ] && {
-
- [ -f /tmp/run/restorefactory.pid ] && read PID < /tmp/run/restorefactory.pid && kill $PID && rm /tmp/run/restorefactory.pid && logger -p user.info -t "restorefactory" "restore to factory defaults aborted"
-
- [ "$ACTION" = "$action" ] && {
-
- if [ "$timeout" -gt 0 ]
- then
- sleep "$timeout" && firstboot && reboot &
- echo $! > /tmp/run/restorefactory.pid
- logger -p user.info -t "restorefactory" "restoring to factory defaults in $timeout seconds"
- elif [ "$timeout" -eq 0 ]
- then
- firstboot && reboot &
- else
- logger -p user.info -t "restorefactory" "invalid timeout value ($timeout)"
- fi
- }
-}
-
+++ /dev/null
-#!/bin/sh
-uci add system restorefactory
-uci set system.@restorefactory[0].button=reset
-uci set system.@restorefactory[0].action=pressed
-uci set system.@restorefactory[0].timeout=5
-uci commit
--- /dev/null
+#!/bin/sh
+
+system_config() {
+ config_get button "$1" button "reset"
+ config_get action "$1" action "pressed"
+ config_get timeout "$1" timeout "5"
+}
+
+config_load system
+config_foreach system_config restorefactory
+
+[ "$BUTTON" = "$button" ] && {
+
+ [ -f /tmp/run/restorefactory.pid ] && read PID < /tmp/run/restorefactory.pid && kill $PID && rm /tmp/run/restorefactory.pid && logger -p user.info -t "restorefactory" "restore to factory defaults aborted"
+
+ [ "$ACTION" = "$action" ] && {
+
+ if [ "$timeout" -gt 0 ]
+ then
+ sleep "$timeout" && firstboot && reboot &
+ echo $! > /tmp/run/restorefactory.pid
+ logger -p user.info -t "restorefactory" "restoring to factory defaults in $timeout seconds"
+ elif [ "$timeout" -eq 0 ]
+ then
+ firstboot && reboot &
+ else
+ logger -p user.info -t "restorefactory" "invalid timeout value ($timeout)"
+ fi
+ }
+}
+
--- /dev/null
+#!/bin/sh
+uci add system restorefactory
+uci set system.@restorefactory[0].button=reset
+uci set system.@restorefactory[0].action=pressed
+uci set system.@restorefactory[0].timeout=5
+uci commit
PKG_NAME:=watchcat
PKG_VERSION:=1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
include $(INCLUDE_DIR)/package.mk
define Package/watchcat/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/initd_watchcat $(1)/etc/init.d/watchcat
- $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_DIR) $(1)/etc/defaults
$(INSTALL_BIN) ./files/uci_defaults_watchcat $(1)/etc/defaults/50-watchcat
endef