[OpenWrt-Devel] fstools / always fires 'uci commit' each reboot

Lars Kruse lists at sumpfralle.de
Wed Jan 28 18:56:33 EST 2015


> [..]
> 1)
> can we change that behaviour for this single script?
> (delete it during first run).

I guess, that script's execution should be considered successful, even
if /etc/config/fstab already exists. Thus the author just failed to make sure
that the exit code of that script reflects this logic.

I would suggest that
 [ ! -f /etc/config/fstab ] && ( block detect > /etc/config/fstab )
should be changed to:
 [ ! -f /etc/config/fstab ] && block detect > /etc/config/fstab || true
or even better (this does not hide errors in "block detect"):
 [ -f /etc/config/fstab ] || block detect > /etc/config/fstab

(I do not see the need for the subshell here - thus I removed the brackets)

This would make sure that the script exits successfully if there is the fstab
file or if the "block detect" execution finished successfully. Thus the script
would be deleted after its first execution (as it should be).

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list