UCI defaults scripts not running/working?

Hey guys. I am trying to work around an issue I can't seem to solve - X86/64 sysupgrade losing settings (F2FS)?

I have written a small script that checks for DDNS being configured, and, when that is not the case, pulls in a backup to restore the device's settings. The script itself works fine - if I run sh /rom/etc/uci-defaults/99_restore then I see everything being done.

However, the script being integrated in my own builds, after sysupgrading it seems the script hasn't been run. DDNS is still in its default state (disabled), so the script should have been run, and configuration restored, but that's not the case.

Contents of the script:

# Check if DDNS is enabled. If not, pull in the backup from a local server. 
# Abort if download doesn't complete.
/bin/grep enabled /etc/config/ddns || \
/usr/bin/curl http://10.0.0.30/dl/backup-openwrt.tar.gz -o /tmp/backup.tar.gz || exit 1
/sbin/sysupgrade -v -r /tmp/backup.tar.gz
/sbin/reboot

Looks like the network is not available yet when the uci-defaults scripts are run.

root@OpenWrt:/etc/rc.d# ls -l S*boot S*network
lrwxrwxrwx    1 root     root            14 Aug 21 14:57 S10boot -> ../init.d/boot
lrwxrwxrwx    1 root     root            17 Aug 21 14:57 S20network -> ../init.d/network

Thanks. /etc/rc.local it is then :smiley:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.