Elegance in startup scripts

This commit is contained in:
Giulio 2020-09-19 18:15:09 +02:00
parent 2536e74d37
commit aacab67bb8
3 changed files with 4 additions and 1 deletions

View File

@ -2,8 +2,10 @@
case "$1" in case "$1" in
start) start)
printf "Loading kernel modules: "
/sbin/modprobe qca6174 /sbin/modprobe qca6174
/sbin/modprobe wireguard /sbin/modprobe wireguard
[ $? = 0 ] && echo "OK" || echo "FAIL"
;; ;;
*) *)
echo "Usage: $0 {start}" echo "Usage: $0 {start}"

View File

@ -3,7 +3,7 @@
case "$1" in case "$1" in
start) start)
status=`cat /proc/sys/kernel/random/entropy_avail` status=`cat /proc/sys/kernel/random/entropy_avail`
echo "Waiting for enough entropy: " printf "Waiting for enough entropy: "
while [ $status -lt 200 ]; do while [ $status -lt 200 ]; do
sleep 2 sleep 2
status=`cat /proc/sys/kernel/random/entropy_avail` status=`cat /proc/sys/kernel/random/entropy_avail`

View File

@ -11,6 +11,7 @@ case "$1" in
WPA=`cat /etc/wpa` WPA=`cat /etc/wpa`
sed -i "s/{{SSID}}/$SSID/g" /etc/hostapd.conf sed -i "s/{{SSID}}/$SSID/g" /etc/hostapd.conf
sed -i "s/{{WPA}}/$WPA/g" /etc/hostapd.conf sed -i "s/{{WPA}}/$WPA/g" /etc/hostapd.conf
echo "OK"
;; ;;
*) *)
echo "Usage: $0 {start}" echo "Usage: $0 {start}"