immortalwrt/package/ctcgfw/luci-app-233ddns/root/etc/init.d/233ddns
2020-03-06 18:20:57 +08:00

26 lines
553 B
Bash
Executable File

#!/bin/sh /etc/rc.common
# Created By [CTCGFW]Project OpenWRT
# https://github.com/project-openwrt
START=80
STOP=10
enable="$(uci get 233ddns.@233ddns[0].enable)"
token="$(uci get 233ddns.@233ddns[0].token)"
start()
{
stop
[ "${enable}" -ne "1" ] && exit 0
wget -4qO- --header="Cookie: a=a" "https://233ddns.ro/u/${token}"
echo "* * * * * wget -4qO- --header=\"Cookie: a=a\" \"https://233ddns.ro/u/${token}\"" >> "/etc/crontabs/root"
/etc/init.d/cron restart
}
stop()
{
sed -i '/233ddns.ro/d' "/etc/crontabs/root"
/etc/init.d/cron restart
}