diff --git a/ffho/ffho-aptimer/Makefile b/ffho/ffho-ap-timer/Makefile similarity index 77% rename from ffho/ffho-aptimer/Makefile rename to ffho/ffho-ap-timer/Makefile index 539fa6f1182b6ffbda7567730b524620d89a0a2b..dc1c37b91a2d79ba66f530843b67c246f2e51195 100644 --- a/ffho/ffho-aptimer/Makefile +++ b/ffho/ffho-ap-timer/Makefile @@ -1,6 +1,6 @@ include $(TOPDIR)/rules.mk -PKG_NAME:=ffho-aptimer +PKG_NAME:=ffho-ap-timer PKG_VERSION:=1 PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG_VERSION) @@ -8,7 +8,7 @@ PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) include $(INCLUDE_DIR)/package.mk -define Package/ffho-aptimer +define Package/ffho-ap-timer SECTION:=ffho CATEGORY:=FFHO TITLE:=Timer for the client wifi @@ -17,7 +17,7 @@ define Package/ffho-aptimer URL:=https://git.c3pb.de/freifunk-pb/ffho-packages endef -define Package/ffho-aptimer/description +define Package/ffho-ap-timer/description Timer for the client wifi endef @@ -31,8 +31,8 @@ endef define Build/Compile endef -define Package/ffho-aptimer/install +define Package/ffho-ap-timer/install $(CP) ./files/* $(1)/ endef -$(eval $(call BuildPackage,ffho-aptimer)) +$(eval $(call BuildPackage,ffho-ap-timer)) diff --git a/ffho/ffho-aptimer/ReadMe.md b/ffho/ffho-ap-timer/ReadMe.md similarity index 60% rename from ffho/ffho-aptimer/ReadMe.md rename to ffho/ffho-ap-timer/ReadMe.md index aaf4741c34c13142029cc8752d725e4599483095..88207770588ef4e07299c5325f6bfa1452839e62 100644 --- a/ffho/ffho-aptimer/ReadMe.md +++ b/ffho/ffho-ap-timer/ReadMe.md @@ -1,29 +1,29 @@ -ffho-aptimer -============ +ffho-ap-timer +============= Timer for the client wifi with three modes (daily, weekly, monthly) -/etc/config/aptimer +/etc/config/ap-timer ------------------- -**aptimer.settings.enabled:** -- `0` disables the aptimer (default) -- `1` enables the aptimer +**ap-timer.settings.enabled:** +- `0` disables the ap-timer (default) +- `1` enables the ap-timer -**aptimer.settings.type:** +**ap-timer.settings.type:** - `day`, $day = all - `week`, $day = [Mon|Tue|Wed|Thu|Fri|Sat|Sun] - `month`, $day = [01-31] -**aptimer.$day.on:** +**ap-timer.$day.on:** - List of time to enable wireless -**aptimer.$day.off:** +**ap-timer.$day.off:** - List of time to disable wireless ### example ``` -config aptimer 'settings' +config ap-timer 'settings' option enabled '1' option type 'week' diff --git a/ffho/ffho-aptimer/files/etc/config/aptimer b/ffho/ffho-ap-timer/files/etc/config/ap-timer similarity index 77% rename from ffho/ffho-aptimer/files/etc/config/aptimer rename to ffho/ffho-ap-timer/files/etc/config/ap-timer index 74947cbcec1ed2a671bfae06c3341e610bc81ec3..c5fab3dc637ffbf84ad70d15a9a55e0c0b3fecd4 100644 --- a/ffho/ffho-aptimer/files/etc/config/aptimer +++ b/ffho/ffho-ap-timer/files/etc/config/ap-timer @@ -1,4 +1,4 @@ -#config aptimer 'settings' +#config ap-timer 'settings' # option enabled '1' # option type 'day' # diff --git a/ffho/ffho-ap-timer/files/lib/gluon/upgrade/900-remove-aptimer-config b/ffho/ffho-ap-timer/files/lib/gluon/upgrade/900-remove-aptimer-config new file mode 100755 index 0000000000000000000000000000000000000000..fc7a40b40783cabcb681403cd31fa5237289c305 --- /dev/null +++ b/ffho/ffho-ap-timer/files/lib/gluon/upgrade/900-remove-aptimer-config @@ -0,0 +1,2 @@ +#!/bin/sh +rm -f /etc/config/aptimer diff --git a/ffho/ffho-ap-timer/files/usr/lib/micron.d/ap-timer b/ffho/ffho-ap-timer/files/usr/lib/micron.d/ap-timer new file mode 100644 index 0000000000000000000000000000000000000000..d9e623f49ac534d2171f16f62ff4e7b0c0043ee1 --- /dev/null +++ b/ffho/ffho-ap-timer/files/usr/lib/micron.d/ap-timer @@ -0,0 +1 @@ +* * * * * /usr/sbin/ap-timer diff --git a/ffho/ffho-aptimer/files/usr/sbin/aptimer b/ffho/ffho-ap-timer/files/usr/sbin/ap-timer similarity index 80% rename from ffho/ffho-aptimer/files/usr/sbin/aptimer rename to ffho/ffho-ap-timer/files/usr/sbin/ap-timer index 40dee54b05b09ee251885e9204c67026dd2033ca..1626e9897b13f3114af1acbc05538a3060075b98 100755 --- a/ffho/ffho-aptimer/files/usr/sbin/aptimer +++ b/ffho/ffho-ap-timer/files/usr/sbin/ap-timer @@ -17,7 +17,7 @@ function compare(list, value) end function getDay() - local type = uci:get('aptimer','settings','type') + local type = uci:get('ap-timer','settings','type') if type == 'day' then return 'all' elseif type == 'week' then return os.date('%a', timestamp) elseif type == 'month' then return os.date('%d', timestamp) @@ -41,12 +41,12 @@ function apSet(value) end end -if uci:get_bool('aptimer','settings','enabled') then +if uci:get_bool('ap-timer','settings','enabled') then local day = getDay() local current = os.date("%H:%M", timestamp) - local off = compare(uci:get_list('aptimer', day, 'off'), current) - local on = compare(uci:get_list('aptimer', day, 'on'), current) + local off = compare(uci:get_list('ap-timer', day, 'off'), current) + local on = compare(uci:get_list('ap-timer', day, 'on'), current) if on and not off then apSet(true) diff --git a/ffho/ffho-aptimer/files/usr/lib/micron.d/aptimer b/ffho/ffho-aptimer/files/usr/lib/micron.d/aptimer deleted file mode 100644 index 9e793ab4617a83a72dbc0d2fae7b0bc485aae2df..0000000000000000000000000000000000000000 --- a/ffho/ffho-aptimer/files/usr/lib/micron.d/aptimer +++ /dev/null @@ -1 +0,0 @@ -* * * * * /usr/sbin/aptimer