cyberchallenge-modem/conf/etc/init.d/S23cfgbin

22 lines
561 B
Plaintext
Raw Normal View History

2020-05-22 18:21:26 +02:00
#!/bin/sh
case "$1" in
start)
printf "Starting cfgbin: "
/usr/sbin/cfgbin
test -f /etc/serial || exit 0
test -f /etc/ssid || exit 0
test -f /etc/wpa || exit 0
SSID=`cat /etc/ssid`
WPA=`cat /etc/wpa`
sed -i "s/{{SSID}}/$SSID/g" /etc/hostapd.conf
sed -i "s/{{WPA}}/$WPA/g" /etc/hostapd.conf
2020-09-19 18:15:09 +02:00
echo "OK"
2020-05-22 18:21:26 +02:00
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit 0