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>
35 lines
942 B
Plaintext
35 lines
942 B
Plaintext
/etc/init.d/fastd disable
|
|
|
|
>/etc/config/fastd
|
|
|
|
uci batch <<EOF
|
|
set fastd.fff='fastd'
|
|
set fastd.fff.enabled='1'
|
|
set fastd.fff.config_peer_dir="/etc/fastd/fff/peers"
|
|
set fastd.fff.syslog_level='warn'
|
|
set fastd.fff.method='null'
|
|
set fastd.fff.mode='tap'
|
|
set fastd.fff.interface="fffVPN"
|
|
set fastd.fff.mtu='1426'
|
|
set fastd.fff.on_up="/etc/fastd/fff/up.sh"
|
|
set fastd.fff.secure_handshakes='0'
|
|
EOF
|
|
|
|
if ! secret=$(uci -q get fff.fastd.secret); then
|
|
secret=$(/usr/bin/fastd --generate-key --machine-readable)
|
|
uci set fff.fastd='fff'
|
|
uci set fff.fastd.secret="$secret"
|
|
uci commit fff
|
|
fi
|
|
uci set fastd.fff.secret="$secret"
|
|
uci commit fastd
|
|
|
|
[ ! -d /etc/fastd/fff ] && mkdir -p /etc/fastd/fff
|
|
ln -s /tmp/fastd_fff_peers /etc/fastd/fff/peers
|
|
echo "#!/bin/sh" > /etc/fastd/fff/up.sh
|
|
echo "ip link set up dev fffVPN" >> /etc/fastd/fff/up.sh
|
|
echo "batctl if add fffVPN" >> /etc/fastd/fff/up.sh
|
|
chmod +x /etc/fastd/fff/up.sh
|
|
|
|
exit 0
|