Skip to content

Commit

Permalink
sync with stable-v23
Browse files Browse the repository at this point in the history
  • Loading branch information
sandro committed Mar 3, 2024
1 parent 6f6d076 commit 94f5254
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 11 deletions.
1 change: 1 addition & 0 deletions package/base-files/files/bin/config_generate
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ generate_static_system() {
add_list system.ntp.server='3.cn.pool.ntp.org'
set firewall.@defaults[0].flow_offloading='1'
set nft-qos.default.limit_enable='0'
EOF

if json_is_a system object; then
Expand Down
30 changes: 26 additions & 4 deletions target/linux/rockchip/armv8/base-files/etc/init.d/fa-rk3328-pwmfan
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
#!/bin/sh /etc/rc.common

START=96

STOP=10

restart() {
fan_pid=$(ps|grep start-rk3328-pwm-fan|grep -v grep|awk '{print $1}')
kill ${fan_pid}
sleep 1 # give time to shutdown
/usr/bin/start-rk3328-pwm-fan.sh > /dev/null&
}

start() {
echo "fa-pwmfan started"
/usr/bin/start-rk3328-pwm-fan.sh > /dev/null&
fan_pid=$(ps|grep start-rk3328-pwm-fan|grep -v grep|awk '{print $1}')
if [ -z "${fan_pid}" ]
then
echo "PWM fan is started"
/usr/bin/start-rk3328-pwm-fan.sh > /dev/null&
else
echo "PWM fan is already running"
fi
}

stop() {
fan_pid=$(ps|grep start-rk3328-pwm-fan|grep -v grep|awk '{print $1}')
if [ -n "${fan_pid}" ]
then
kill ${fan_pid}
fi
return 0
}
29 changes: 26 additions & 3 deletions target/linux/rockchip/armv8/base-files/etc/init.d/uqmi-daemon
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
#!/bin/sh /etc/rc.common
START=99
STOP=10

START=97

restart() {
uqmi_pid=$(ps|grep uqmi-daemon.sh|grep -v grep|awk '{print $1}')
kill ${uqmi_pid}
sleep 1 # give time to shutdown
/usr/bin/uqmi-daemon.sh &
}

start() {
echo "uqmi daemon is started"
/usr/bin/uqmi-daemon.sh &
uqmi_pid=$(ps|grep uqmi-daemon.sh|grep -v grep|awk '{print $1}')
if [ -z "${uqmi_pid}" ]
then
echo "UQMI daemon is started"
/usr/bin/uqmi-daemon.sh &
else
echo "UQMI daemon is already running"
fi
}

stop() {
uqmi_pid=$(ps|grep uqmi-daemon.sh|grep -v grep|awk '{print $1}')
if [ -n "${uqmi_pid}" ]
then
kill ${uqmi_pid}
fi
return 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ function set_device_operating_mode() {
}

function ping_domain() {
local dnspod=119.29.29.29
local alidns=223.5.5.5
local dnspod=119.29.29.29
local alidns=223.5.5.5
local retries=6
local packets_responded=0

for i in $(seq 1 $retries); do
if ping -c 4 ${dnspod} > /dev/null; then
((packets_responded++))
sleep 3
elif ping -c 4 ${alidns} > /dev/null; then
((packets_responded++))
elif ping -c 4 ${alidns} > /dev/null; then
((packets_responded++))
sleep 3
fi
done
Expand All @@ -31,6 +31,25 @@ function ping_domain() {
fi
}

function ddns_ondemand() {
# Check if service is started on boot
/etc/init.d/ddns enabled
if [ $? -eq 1 ]
then
echo "$(date '+%Y-%m-%d %H:%M:%S'): DDNS is not enabled autostart, nothing to do..." >> ${QMI_LOG}
return
fi
ps_ddns=$(ps|grep dynamic_dns_upd|grep -v grep)
if [ -z "${ps_ddns}" ]
then
echo "$(date '+%Y-%m-%d %H:%M:%S'): DDNS is enabled autostart but is not running, start it..." >> ${QMI_LOG}
/etc/init.d/ddns start
else
echo "$(date '+%Y-%m-%d %H:%M:%S'): Restart DDNS..." >> ${QMI_LOG}
/etc/init.d/ddns restart
fi
}

echo /dev/null > ${QMI_LOG}
echo "$(date '+%Y-%m-%d %H:%M:%S'): QMI daemon is started..." > ${QMI_LOG}

Expand All @@ -53,6 +72,7 @@ while true; do
NETWORK_STATUS=true
FAILED_COUNT=0
echo "$(date '+%Y-%m-%d %H:%M:%S'): Network is reachable" >> ${QMI_LOG}
ddns_ondemand
fi
fi
sleep 1800
Expand Down

0 comments on commit 94f5254

Please sign in to comment.