then
exit 1
fi
+ if [ $CYCLES_WAITED -eq 0 ]
+ then
+ echo -n "Waiting for NetworkManager"
+ fi
echo -n .
sleep 1
CYCLES_WAITED=$(( $CYCLES_WAITED + 1 ))
done
[ $CYCLES_WAITED -gt 0 ] && echo
-# wait for one/the network connection to come up
+# wait for the two network connections to come up
CONNECTION_DEVICES_UP=$(nmcli --terse connection show \
| grep --invert-match ':$' | wc -l)
CYCLES_WAITED=0
-while [ $CONNECTION_DEVICES_UP -lt 1 ]
+while [ $CONNECTION_DEVICES_UP -lt 2 ]
do
if [ $CYCLES_WAITED -ge 10 ]
then
nmcli connection show
exit 1
fi
+ if [ $CYCLES_WAITED -eq 0 ]
+ then
+ echo -n "Waiting for the network connection"
+ fi
echo -n .
sleep 1
CYCLES_WAITED=$(( $CYCLES_WAITED + 1 ))
[ $CYCLES_WAITED -gt 0 ] && echo
CONNECTIONS=$(nmcli --terse connection show | wc -l)
-if [ $CONNECTIONS -ne 1 ]
+if [ $CONNECTIONS -ne 2 ]
then
- echo "Number of connections: $CONNECTIONS" >&2
+ echo "Number of connections: $CONNECTIONS instead of 2" >&2
exit 1
fi
-CONNECTION_LINE=$(nmcli --terse connection show)
+CONNECTION_LINE=$(nmcli --terse connection show | grep ':eth0$')
CONNECTION_UUID=$(echo $CONNECTION_LINE | cut -f 2 -d ':')
CONNECTION_DEVICE=$(echo $CONNECTION_LINE | cut -f 4 -d ':')
save yes
nmcli connection show
+
+hostnamectl hostname sns.in.useribm.hu
+hostnamectl