forked from freifunk-franken/firmware
uci-defaults scripts are supposed to be run once after firstboot and then removed. However, the removal only takes place if the subshell created for the sourced scripts returns exit code 0. For some of the files, the last command returned a different exit code, though, leading to the script remaining in its location and being executed for every boot. To prevent cases like the latter, this adds an "exit 0" to all uci-defaults files in our package store. While at it, remove the shebang for all these files since they are sourced (and not executed). Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Reviewed-by: Fabian Bläse <fabian@blaese.de>
24 lines
652 B
Plaintext
24 lines
652 B
Plaintext
# Copyright 2017 Adrian Schmutzler
|
|
# License GPLv3
|
|
|
|
touch /etc/config/fff
|
|
|
|
if ! uci -q get fff.system > /dev/null ; then
|
|
uci set fff.system=fff
|
|
uci set "fff.system.hostname=FFF"
|
|
uci commit fff
|
|
fi
|
|
|
|
FFF_hostname=$(uci -q get "fff.system.hostname")
|
|
test -n "${FFF_hostname}" && uci -q set "system.@system[0].hostname=${FFF_hostname}"
|
|
test -n "${FFF_hostname}" && echo "${FFF_hostname}" > /proc/sys/kernel/hostname
|
|
|
|
uci commit system
|
|
|
|
poe_passthrough=$(uci -q get "fff.poe_passthrough.active")
|
|
if [ "$poe_passthrough" = "1" ] && [ -s /usr/lib/fff-support/activate_poe_passthrough.sh ] ; then
|
|
/usr/lib/fff-support/activate_poe_passthrough.sh
|
|
fi
|
|
|
|
exit 0
|