mirror of
https://github.com/kenzok8/small-package
synced 2025-09-18 18:51:16 +08:00
update 2023-01-20 20:19:19
This commit is contained in:
@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=brook
|
||||
PKG_VERSION:=20230101
|
||||
PKG_VERSION:=20230122
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/txthinking/brook/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=d131b408102ef6865c64a7cf9d7417308ef3109c79dc627e01bfd665cf80e47c
|
||||
PKG_HASH:=52643df51144b4b1afbacb51156f92ba61adbcff77dd8f76e3278ce70644f237
|
||||
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
|
@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk
|
||||
LUCI_TITLE:=LuCI support for Scheduled Time setting
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_VERSION:=1.6
|
||||
PKG_RELEASE:=20230115
|
||||
PKG_VERSION:=1.7
|
||||
PKG_RELEASE:=20230120
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/autotimeset
|
||||
|
@ -20,6 +20,7 @@ e:value(5,translate("Scheduled Restartwan"))
|
||||
e:value(6,translate("Scheduled Closewan"))
|
||||
e:value(7,translate("Scheduled Clearmem"))
|
||||
e:value(8,translate("Scheduled Sysfree"))
|
||||
e:value(9,translate("Scheduled DisReconn"))
|
||||
e.default=2
|
||||
|
||||
week=s:option(ListValue,"week",translate("Week Day"))
|
||||
|
@ -31,6 +31,9 @@ msgstr "定时释放内存"
|
||||
msgid "Scheduled Sysfree"
|
||||
msgstr "定时系统清理"
|
||||
|
||||
msgid "Scheduled DisReconn"
|
||||
msgstr "检测断线重连"
|
||||
|
||||
msgid "Week Day"
|
||||
msgstr "设定星期"
|
||||
|
||||
|
@ -49,6 +49,10 @@ do
|
||||
local cmd="$minute $hour * * $week /usr/bin/timesethandler sysfree"
|
||||
echo "$cmd" >> /etc/crontabs/root
|
||||
;;
|
||||
9)
|
||||
local cmd="$minute $hour * * $week /usr/bin/timesethandler disreconn"
|
||||
echo "$cmd" >> /etc/crontabs/root
|
||||
;;
|
||||
esac
|
||||
|
||||
fi
|
||||
|
@ -1,6 +1,30 @@
|
||||
#!/bin/sh
|
||||
# author 2021 jjm2473
|
||||
# author 2020-2023 sirpdboy
|
||||
# author 2020-2023 sirpdboy
|
||||
|
||||
disreconnwan() {
|
||||
i=0
|
||||
PingA=114.114.114.114
|
||||
PingB=223.5.5.5
|
||||
while [[ $i -lt 5 ]]
|
||||
do
|
||||
if /bin/ping -c 1 $PingA >/dev/null
|
||||
then
|
||||
PingErr=0
|
||||
break
|
||||
else
|
||||
if /bin/ping -c 1 $PingB >/dev/null
|
||||
then
|
||||
PingErr=0
|
||||
break
|
||||
else
|
||||
i=$(($i + 1))
|
||||
PingErr=1
|
||||
sleep 10
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
trigger() {
|
||||
case "$1" in
|
||||
@ -39,15 +63,22 @@ trigger() {
|
||||
/etc/init.d/samba4 restart
|
||||
;;
|
||||
restartwan)
|
||||
ifdown wan
|
||||
# ifdown wan
|
||||
ifup wan
|
||||
;;
|
||||
|
||||
closewan)
|
||||
ifdown wan
|
||||
;;
|
||||
disreconn)
|
||||
disreconnwan
|
||||
if [ $PingErr = 1 ]; then
|
||||
ifup wan
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
PingErr=0
|
||||
logger -p warn -t "autotimeset" "Automatic timing operation execution operation:$@, execution time: `date `" && trigger $@
|
||||
|
||||
|
@ -35,7 +35,7 @@ define Build/Compile
|
||||
( \
|
||||
pushd "$(PKG_BUILD_DIR)"; \
|
||||
yarn install; \
|
||||
NODE_OPTIONS=--openssl-legacy-provider yarn build; \
|
||||
yarn build; \
|
||||
popd ; \
|
||||
)
|
||||
endef
|
||||
|
Reference in New Issue
Block a user