sono alle prime armi con il raspberry e non riesco a fare partire questo script:
Code: Select all
#!/bin/bash
#=================================================================
# Script Variables Settings
wlan='wlan0'
gateway='8.8.4.4'
alias ifup='/sbin/ifup'
alias ifdown='/sbin/ifdown'
alias ifconfig='/sbin/ifconfig'
# Only send two pings, sending output to /dev/null as we don't want to fill logs on our sd card.
# If you want to force ping from your wlan0 you can connect next line and uncomment second line
ping -c2 ${gateway} > /dev/null # ping to gateway from Wi-Fi or from Ethernet
# ping -I ${wlan} -c2 ${gateway} > /dev/null # only ping through Wi-Fi
# If the return code from ping ($?) is not 0 (meaning there was an error)
if [ $? != 0 ]
then
ifdown --force wlan0
ifup wlan0
sleep 5
ifup wlan0;
fi
ping -I ${wlan} -c2 ${gateway} > /dev/null
echo " - Auto Reconnect Wi-Fi Status for $wlan Script Ended ";
/home/pi/Scripts/check_wifi.sh: 22: /home/pi/Scripts/check_wifi.sh: Syntax error: end of file unexpected (expecting "then")
Cosa potrebbe essere?