Subversion Repositories ALCASAR

Compare Revisions

Regard whitespace Rev 2980 → Rev 2981

/alcasar.sh
232,7 → 232,7
{
# Detect external/internal interfaces
if [ -z "$EXTIF" ]; then
EXTIF=$(/usr/sbin/ip route list | awk '/^default / {print $5}')
EXTIF=$(/usr/sbin/ip route list | awk '/ via / {print $5}' | uniq)
if [ -z "$EXTIF" ]; then
if [ "$Lang" == 'fr' ]
then echo "Aucune passerelle par défaut configurée"
334,7 → 334,7
# Test EXTIF config files
PUBLIC_IP_MASK=`/usr/sbin/ip addr show $EXTIF | grep '^\s*inet\s' | awk '{ print $2 }'`
PUBLIC_IP=`echo $PUBLIC_IP_MASK | cut -d'/' -f1`
PUBLIC_GATEWAY=`/usr/sbin/ip route list | awk -v EXTIF="$EXTIF" '(/^default / && $5 == EXTIF) {print $3}'`
PUBLIC_GATEWAY=`/usr/sbin/ip route list | awk -v EXTIF="$EXTIF" '(/ via / && $5 == EXTIF) {print $3}' | head -n 1`
if [ "$(echo $PUBLIC_IP|wc -c)" -lt 7 ] || [ "$(echo $PUBLIC_GATEWAY|wc -c)" -lt 7 ]
then
if [ $Lang == "fr" ]
359,21 → 359,6
exit 1
fi
echo -n "."
# Test if default GW is set on EXTIF (router or ISP provider equipment)
if [ "$(/usr/sbin/ip route list|grep " $EXTIF "|grep -c '^default ')" -ne 1 ] ; then
if [ $Lang == "fr" ]
then
echo -e "\nÉchec"
echo "Vous n'avez pas configuré l'accès à Internet ou le câble réseau n'est pas sur la bonne carte."
echo "Réglez ce problème puis relancez ce script."
else
echo -e "\nFailed"
echo "You haven't configured Internet access or Internet link is on the wrong Ethernet card"
echo "Resolv this problem, then restart this script."
fi
exit 1
fi
echo -n "."
# Test if default GW is alive
arp_reply=`/usr/sbin/arping -b -I$EXTIF -c1 -w2 $PUBLIC_GATEWAY|grep response|cut -d" " -f2`
if [ "$(expr $arp_reply)" -eq 0 ]