MissingTwins
Regular Contributor
On every occasion, unplug and re-plug the router power will cause the last cru task malformed as below.
The last one means the last shown with cru l, so sometimes, others get corrupted but always at the last position of cru l.
This problem lasts for several years, till current 386.7_2
Sometime the corrupted task gets quoted like this
cru tasks are added by wan-event shown as below
/jffs/scripts/wan-event
/jffs/scripts/myservices.sh
It's so annoying, so I have added several more cru tasks to counter attack, and made a cru_guard.sh task
The last one means the last shown with cru l, so sometimes, others get corrupted but always at the last position of cru l.
This problem lasts for several years, till current 386.7_2
>cru l
*/1 * * * * /opt/etc/init.d/S90zerotier-one.sh start #ZeroTierDaemon#
*/5 * * * * /jffs/scripts/cloudflare-ddns-update.sh 4 mydomain.com ipv4#cloudflare.ipv4#
*/5 * * * * /jffs/scripts/cloudflare-ddns-update.sh 6 mydomain.com ipv6#cloudflare.ipv6#
*/2 * * * * /jffs/scripts/rdp-ipv6-mapping.sh #RdpIPv6Daemon#
0 10 * * * echo nop &>/dev/null #DummyDaemon#
00 2 * * Mon sh /opt/share/diversion/file/update-bl.div reset #Diversion_UpdateBL#
20 5 * * * sh /opt/share/diversion/file/rotate-logs.div #Diversion_RotateLogs#
20 17 * * * diversion count_ads count #Diversion_CountAds#
30 12 * * * service restart_letsencrypt #LetsEncrypt#
*/2 @2 @2 @2 @2 /opt/etc/init.d/server-guard.sh start #ServerDaemon#
Sometime the corrupted task gets quoted like this
And both of the corrupted tasks can be fixed manually with cru d/cru a."*/1 * * * * /opt/etc/init.d/S90zerotier-one.sh start" #ZeroTierDaemon#
cru tasks are added by wan-event shown as below
/jffs/scripts/wan-event
Bash:#!/bin/sh echo "wan-event Enter" logger -t "wan-event" -c "Enter" -p user.notice logger -t "wan-event" -c "WAN"$1", eventType="$2" " -p user.notice if [ "connected" == "$2" ]; then echo "Detect connection" logger -t "wan-event" "Detect connection" -p user.notice /jffs/scripts/myservices.sh fi echo "wan-event leaving" logger -t "wan-event" "Leaving" -p user.notice
/jffs/scripts/myservices.sh
Bash:#!/bin/sh echo "Starting script myservices.sh" logger -t "myservices.sh" -c "Enter" -p user.notice #---------------------------------- cru a DummyDaemon "0 10 * * * echo nop &>/dev/null" cru a ZeroTierDaemon "*/1 * * * * /opt/etc/init.d/S90zerotier-one.sh start" cru a ServerDaemon "*/2 * * * * /opt/etc/init.d/server-guard.sh start" cru a matrixbot "*/1 * * * * /jffs/scripts/matrixbot.sh myservices NN" #---------------------------------- # Detecting ipv6 changing every 5 minutes cru a cloudflare.ipv4 "*/5 * * * * /jffs/scripts/cloudflare-ddns-update.sh 4 mydomain.com ipv4" cru a cloudflare.ipv6 "*/5 * * * * /jffs/scripts/cloudflare-ddns-update.sh 6 mydomain.com ipv6" #---------------------------------- cru d cloudflare.delay4 cru a cloudflare.delay4 "*/1 * * * * /jffs/scripts/cloudflare-ddns-update.sh 4 mydomain.com ipv4 cloudflare.delay4" cru d cloudflare.delay6 cru a cloudflare.delay6 "*/1 * * * * /jffs/scripts/cloudflare-ddns-update.sh 6 mydomain.com ipv6 cloudflare.delay6" cru d RdpIPv6Daemon cru a RdpIPv6Daemon "*/2 * * * * /jffs/scripts/rdp-ipv6-mapping.sh" #---------------------------------- # remove double quote in zerotier task bug? cru d DummyDaemon cru a DummyDaemon "0 10 * * * echo nop &>/dev/null" echo "after myservices.sh" logger -t "myservices.sh" -c "Leaving" -p user.notice
It's so annoying, so I have added several more cru tasks to counter attack, and made a cru_guard.sh task
Bash:#!/bin/sh cat /jffs/scripts/myservices.sh | while IFS= read -r line ; do cru_name=$(echo "$line" | grep -iPo '^\s*cru\s+a\s+\K[\w.-]+' ) cru_body=$(echo "$line" | grep -iPo '^\s*cru\s+a\s+[\w.-]+\s+\"?\K[^"]+' ) if [ -n "$cru_name" ] && [ -n "$cru_body" ] ;then #echo "${cru_name} | ${cru_body}" tst=$(echo "$task_body1" | grep -i "${cru_name}") if [ "$?" -eq 0 ];then echo "Found OnDuty Task $tst" tst2=$(echo "$tst" | grep -iPo "^(?:[*\/\d]+\s+){5}") if [ "$?" -ne 0 ];then cru d "${cru_name}" cru a "${cru_name}" "${cru_body}" sysLOG "Found malformed and reconstructed: ${cru_body}" error fi echo "" fi fi done
Last edited: