From: Zoltán Felleg Date: Thu, 14 Mar 2019 12:47:16 +0000 (+0100) Subject: Updated {ins,ldap,svc,vpn}.usr.f29, {ws,xfr}.pm.f29 (setupnetworking script). X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=f7087b4e35ed28cfca7e72ebf9e595307f3fa814;p=user-lxc.git Updated {ins,ldap,svc,vpn}.usr.f29, {ws,xfr}.pm.f29 (setupnetworking script). --- diff --git a/sources/ins.usr.f29/firstboot/01_setupnetworking.sh b/sources/ins.usr.f29/firstboot/01_setupnetworking.sh index e8b53db..2e1d525 100755 --- a/sources/ins.usr.f29/firstboot/01_setupnetworking.sh +++ b/sources/ins.usr.f29/firstboot/01_setupnetworking.sh @@ -13,42 +13,43 @@ do systemctl --quiet is-active NetworkManager.service NM_RC=$? done -[ $WAITED -ne 0 ] && echo +[ $WAITED -eq 1 ] && echo -CONNECTIONS=$(nmcli connection show | grep -v '^NAME' | wc -l) -if [ $CONNECTIONS -ne 1 ] -then +CONNECTIONS=$(nmcli --terse connection show | wc -l) +while [ $CONNECTIONS -ne 1 ] +do echo "Number of connections: $CONNECTIONS" >&2 - exit 1 -fi - -CONNECTION_LINE=$(nmcli connection show | grep -v '^NAME') -CONNECTION_TOKENS=$(echo $CONNECTION_LINE | wc -w) -#CONNECTION_NAME_POS=$(( $CONNECTION_TOKENS - 3 )) -CONNECTION_UUID_POS=$(( $CONNECTION_TOKENS - 2 )) -#CONNECTION_TYPE_POS=$(( $CONNECTION_TOKENS - 1 )) -CONNECTION_DEVICE_POS=$CONNECTION_TOKENS -#CONNECTION_NAME=$(echo $CONNECTION_LINE \ -# | cut -f -$CONNECTION_NAME_POS -d ' ') -CONNECTION_UUID=$(echo $CONNECTION_LINE \ - | cut -f $CONNECTION_UUID_POS -d ' ') -#CONNECTION_TYPE=$(echo $CONNECTION_LINE \ -# | cut -f $CONNECTION_TYPE_POS -d ' ') -CONNECTION_DEVICE=$(echo $CONNECTION_LINE \ - | cut -f $CONNECTION_DEVICE_POS -d ' ') + sleep 1 + CONNECTIONS=$(nmcli --terse connection show | wc -l) +done + +nmcli --terse connection show | grep ':$' >/dev/null +ALL_CONNECTION_DEVICES_KNOWN=$? +while [ $ALL_CONNECTION_DEVICES_KNOWN -eq 0 ] +do + echo "Not all connection devices are known yet" >&2 + sleep 1 + nmcli --terse connection show | grep ':$' >/dev/null + ALL_CONNECTION_DEVICES_KNOWN=$? +done + +CONNECTION_LINE=$(nmcli --terse connection show) +CONNECTION_UUID=$(echo $CONNECTION_LINE | cut -f 2 -d ':') +CONNECTION_DEVICE=$(echo $CONNECTION_LINE | cut -f 4 -d ':') nmcli connection delete uuid "$CONNECTION_UUID" nmcli connection add \ - type 802-3-ethernet \ - ifname $CONNECTION_DEVICE \ - con-name internal \ - autoconnect yes \ - save yes \ + connection.autoconnect yes \ + connection.id internal \ + connection.interface-name $CONNECTION_DEVICE \ + connection.type 802-3-ethernet \ ipv4.addresses "10.228.109.104/16" \ ipv4.dns "10.228.109.253, 10.228.109.104" \ ipv4.dns-search "usr.user.hu" \ ipv4.gateway "10.228.109.254" \ ipv4.method "manual" \ - ipv6.method "ignore" + ipv6.method "ignore" \ + save yes + nmcli connection show diff --git a/sources/ldap.usr.f29/firstboot/01_setupnetworking.sh b/sources/ldap.usr.f29/firstboot/01_setupnetworking.sh index 31cd82c..e78cb34 100755 --- a/sources/ldap.usr.f29/firstboot/01_setupnetworking.sh +++ b/sources/ldap.usr.f29/firstboot/01_setupnetworking.sh @@ -13,42 +13,43 @@ do systemctl --quiet is-active NetworkManager.service NM_RC=$? done -[ $WAITED -ne 0 ] && echo +[ $WAITED -eq 1 ] && echo -CONNECTIONS=$(nmcli connection show | grep -v '^NAME' | wc -l) -if [ $CONNECTIONS -ne 1 ] -then +CONNECTIONS=$(nmcli --terse connection show | wc -l) +while [ $CONNECTIONS -ne 1 ] +do echo "Number of connections: $CONNECTIONS" >&2 - exit 1 -fi - -CONNECTION_LINE=$(nmcli connection show | grep -v '^NAME') -CONNECTION_TOKENS=$(echo $CONNECTION_LINE | wc -w) -#CONNECTION_NAME_POS=$(( $CONNECTION_TOKENS - 3 )) -CONNECTION_UUID_POS=$(( $CONNECTION_TOKENS - 2 )) -#CONNECTION_TYPE_POS=$(( $CONNECTION_TOKENS - 1 )) -CONNECTION_DEVICE_POS=$CONNECTION_TOKENS -#CONNECTION_NAME=$(echo $CONNECTION_LINE \ -# | cut -f -$CONNECTION_NAME_POS -d ' ') -CONNECTION_UUID=$(echo $CONNECTION_LINE \ - | cut -f $CONNECTION_UUID_POS -d ' ') -#CONNECTION_TYPE=$(echo $CONNECTION_LINE \ -# | cut -f $CONNECTION_TYPE_POS -d ' ') -CONNECTION_DEVICE=$(echo $CONNECTION_LINE \ - | cut -f $CONNECTION_DEVICE_POS -d ' ') + sleep 1 + CONNECTIONS=$(nmcli --terse connection show | wc -l) +done + +nmcli --terse connection show | grep ':$' >/dev/null +ALL_CONNECTION_DEVICES_KNOWN=$? +while [ $ALL_CONNECTION_DEVICES_KNOWN -eq 0 ] +do + echo "Not all connection devices are known yet" >&2 + sleep 1 + nmcli --terse connection show | grep ':$' >/dev/null + ALL_CONNECTION_DEVICES_KNOWN=$? +done + +CONNECTION_LINE=$(nmcli --terse connection show) +CONNECTION_UUID=$(echo $CONNECTION_LINE | cut -f 2 -d ':') +CONNECTION_DEVICE=$(echo $CONNECTION_LINE | cut -f 4 -d ':') nmcli connection delete uuid "$CONNECTION_UUID" nmcli connection add \ - type 802-3-ethernet \ - ifname $CONNECTION_DEVICE \ - con-name internal \ - autoconnect yes \ - save yes \ + connection.autoconnect yes \ + connection.id internal \ + connection.interface-name $CONNECTION_DEVICE \ + connection.type 802-3-ethernet \ ipv4.addresses "10.228.109.252/16" \ ipv4.dns "10.228.109.104, 10.228.109.253" \ ipv4.dns-search "usr.user.hu" \ ipv4.gateway "10.228.109.254" \ ipv4.method "manual" \ - ipv6.method "ignore" + ipv6.method "ignore" \ + save yes + nmcli connection show diff --git a/sources/svc.usr.f29/firstboot/01_setupnetworking.sh b/sources/svc.usr.f29/firstboot/01_setupnetworking.sh index b4a0077..f425fed 100755 --- a/sources/svc.usr.f29/firstboot/01_setupnetworking.sh +++ b/sources/svc.usr.f29/firstboot/01_setupnetworking.sh @@ -13,42 +13,43 @@ do systemctl --quiet is-active NetworkManager.service NM_RC=$? done -[ $WAITED -ne 0 ] && echo +[ $WAITED -eq 1 ] && echo -CONNECTIONS=$(nmcli connection show | grep -v '^NAME' | wc -l) -if [ $CONNECTIONS -ne 1 ] -then +CONNECTIONS=$(nmcli --terse connection show | wc -l) +while [ $CONNECTIONS -ne 1 ] +do echo "Number of connections: $CONNECTIONS" >&2 - exit 1 -fi - -CONNECTION_LINE=$(nmcli connection show | grep -v '^NAME') -CONNECTION_TOKENS=$(echo $CONNECTION_LINE | wc -w) -#CONNECTION_NAME_POS=$(( $CONNECTION_TOKENS - 3 )) -CONNECTION_UUID_POS=$(( $CONNECTION_TOKENS - 2 )) -#CONNECTION_TYPE_POS=$(( $CONNECTION_TOKENS - 1 )) -CONNECTION_DEVICE_POS=$CONNECTION_TOKENS -#CONNECTION_NAME=$(echo $CONNECTION_LINE \ -# | cut -f -$CONNECTION_NAME_POS -d ' ') -CONNECTION_UUID=$(echo $CONNECTION_LINE \ - | cut -f $CONNECTION_UUID_POS -d ' ') -#CONNECTION_TYPE=$(echo $CONNECTION_LINE \ -# | cut -f $CONNECTION_TYPE_POS -d ' ') -CONNECTION_DEVICE=$(echo $CONNECTION_LINE \ - | cut -f $CONNECTION_DEVICE_POS -d ' ') + sleep 1 + CONNECTIONS=$(nmcli --terse connection show | wc -l) +done + +nmcli --terse connection show | grep ':$' >/dev/null +ALL_CONNECTION_DEVICES_KNOWN=$? +while [ $ALL_CONNECTION_DEVICES_KNOWN -eq 0 ] +do + echo "Not all connection devices are known yet" >&2 + sleep 1 + nmcli --terse connection show | grep ':$' >/dev/null + ALL_CONNECTION_DEVICES_KNOWN=$? +done + +CONNECTION_LINE=$(nmcli --terse connection show) +CONNECTION_UUID=$(echo $CONNECTION_LINE | cut -f 2 -d ':') +CONNECTION_DEVICE=$(echo $CONNECTION_LINE | cut -f 4 -d ':') nmcli connection delete uuid "$CONNECTION_UUID" nmcli connection add \ - type 802-3-ethernet \ - ifname $CONNECTION_DEVICE \ - con-name internal \ - autoconnect yes \ - save yes \ + connection.autoconnect yes \ + connection.id internal \ + connection.interface-name $CONNECTION_DEVICE \ + connection.type 802-3-ethernet \ ipv4.addresses "10.228.109.253/16" \ ipv4.dns "10.228.109.104, 10.228.109.253" \ ipv4.dns-search "usr.user.hu" \ ipv4.gateway "10.228.109.254" \ ipv4.method "manual" \ - ipv6.method "ignore" + ipv6.method "ignore" \ + save yes + nmcli connection show diff --git a/sources/vpn.usr.f29/firstboot/01_setupnetworking.sh b/sources/vpn.usr.f29/firstboot/01_setupnetworking.sh index 25b401d..eee7b91 100755 --- a/sources/vpn.usr.f29/firstboot/01_setupnetworking.sh +++ b/sources/vpn.usr.f29/firstboot/01_setupnetworking.sh @@ -13,42 +13,43 @@ do systemctl --quiet is-active NetworkManager.service NM_RC=$? done -[ $WAITED -ne 0 ] && echo +[ $WAITED -eq 1 ] && echo -CONNECTIONS=$(nmcli connection show | grep -v '^NAME' | wc -l) -if [ $CONNECTIONS -ne 1 ] -then +CONNECTIONS=$(nmcli --terse connection show | wc -l) +while [ $CONNECTIONS -ne 1 ] +do echo "Number of connections: $CONNECTIONS" >&2 - exit 1 -fi - -CONNECTION_LINE=$(nmcli connection show | grep -v '^NAME') -CONNECTION_TOKENS=$(echo $CONNECTION_LINE | wc -w) -#CONNECTION_NAME_POS=$(( $CONNECTION_TOKENS - 3 )) -CONNECTION_UUID_POS=$(( $CONNECTION_TOKENS - 2 )) -#CONNECTION_TYPE_POS=$(( $CONNECTION_TOKENS - 1 )) -CONNECTION_DEVICE_POS=$CONNECTION_TOKENS -#CONNECTION_NAME=$(echo $CONNECTION_LINE \ -# | cut -f -$CONNECTION_NAME_POS -d ' ') -CONNECTION_UUID=$(echo $CONNECTION_LINE \ - | cut -f $CONNECTION_UUID_POS -d ' ') -#CONNECTION_TYPE=$(echo $CONNECTION_LINE \ -# | cut -f $CONNECTION_TYPE_POS -d ' ') -CONNECTION_DEVICE=$(echo $CONNECTION_LINE \ - | cut -f $CONNECTION_DEVICE_POS -d ' ') + sleep 1 + CONNECTIONS=$(nmcli --terse connection show | wc -l) +done + +nmcli --terse connection show | grep ':$' >/dev/null +ALL_CONNECTION_DEVICES_KNOWN=$? +while [ $ALL_CONNECTION_DEVICES_KNOWN -eq 0 ] +do + echo "Not all connection devices are known yet" >&2 + sleep 1 + nmcli --terse connection show | grep ':$' >/dev/null + ALL_CONNECTION_DEVICES_KNOWN=$? +done + +CONNECTION_LINE=$(nmcli --terse connection show) +CONNECTION_UUID=$(echo $CONNECTION_LINE | cut -f 2 -d ':') +CONNECTION_DEVICE=$(echo $CONNECTION_LINE | cut -f 4 -d ':') nmcli connection delete uuid "$CONNECTION_UUID" nmcli connection add \ - type 802-3-ethernet \ - ifname $CONNECTION_DEVICE \ - con-name internal \ - autoconnect yes \ - save yes \ + connection.autoconnect yes \ + connection.id internal \ + connection.interface-name $CONNECTION_DEVICE \ + connection.type 802-3-ethernet \ ipv4.addresses "10.228.109.236/16" \ ipv4.dns "10.228.109.104, 10.228.109.253" \ ipv4.dns-search "usr.user.hu" \ ipv4.gateway "10.228.109.254" \ ipv4.method "manual" \ - ipv6.method "ignore" + ipv6.method "ignore" \ + save yes + nmcli connection show diff --git a/sources/ws.pm.f29/firstboot/01_setupnetworking.sh b/sources/ws.pm.f29/firstboot/01_setupnetworking.sh index adb88f5..dd750d3 100755 --- a/sources/ws.pm.f29/firstboot/01_setupnetworking.sh +++ b/sources/ws.pm.f29/firstboot/01_setupnetworking.sh @@ -13,43 +13,44 @@ do systemctl --quiet is-active NetworkManager.service NM_RC=$? done -[ $WAITED -ne 0 ] && echo +[ $WAITED -eq 1 ] && echo -CONNECTIONS=$(nmcli connection show | grep -v '^NAME' | wc -l) -if [ $CONNECTIONS -ne 1 ] -then +CONNECTIONS=$(nmcli --terse connection show | wc -l) +while [ $CONNECTIONS -ne 1 ] +do echo "Number of connections: $CONNECTIONS" >&2 - exit 1 -fi - -CONNECTION_LINE=$(nmcli connection show | grep -v '^NAME') -CONNECTION_TOKENS=$(echo $CONNECTION_LINE | wc -w) -#CONNECTION_NAME_POS=$(( $CONNECTION_TOKENS - 3 )) -CONNECTION_UUID_POS=$(( $CONNECTION_TOKENS - 2 )) -#CONNECTION_TYPE_POS=$(( $CONNECTION_TOKENS - 1 )) -CONNECTION_DEVICE_POS=$CONNECTION_TOKENS -#CONNECTION_NAME=$(echo $CONNECTION_LINE \ -# | cut -f -$CONNECTION_NAME_POS -d ' ') -CONNECTION_UUID=$(echo $CONNECTION_LINE \ - | cut -f $CONNECTION_UUID_POS -d ' ') -#CONNECTION_TYPE=$(echo $CONNECTION_LINE \ -# | cut -f $CONNECTION_TYPE_POS -d ' ') -CONNECTION_DEVICE=$(echo $CONNECTION_LINE \ - | cut -f $CONNECTION_DEVICE_POS -d ' ') + sleep 1 + CONNECTIONS=$(nmcli --terse connection show | wc -l) +done + +nmcli --terse connection show | grep ':$' >/dev/null +ALL_CONNECTION_DEVICES_KNOWN=$? +while [ $ALL_CONNECTION_DEVICES_KNOWN -eq 0 ] +do + echo "Not all connection devices are known yet" >&2 + sleep 1 + nmcli --terse connection show | grep ':$' >/dev/null + ALL_CONNECTION_DEVICES_KNOWN=$? +done + +CONNECTION_LINE=$(nmcli --terse connection show) +CONNECTION_UUID=$(echo $CONNECTION_LINE | cut -f 2 -d ':') +CONNECTION_DEVICE=$(echo $CONNECTION_LINE | cut -f 4 -d ':') nmcli connection delete uuid "$CONNECTION_UUID" nmcli connection add \ - type 802-3-ethernet \ - ifname $CONNECTION_DEVICE \ - con-name perimeter \ - autoconnect yes \ - save yes \ + connection.autoconnect yes \ + connection.id perimeter \ + connection.interface-name $CONNECTION_DEVICE \ + connection.type 802-3-ethernet \ ipv4.addresses "192.168.173.249/24" \ ipv4.dns "192.168.173.174" \ ipv4.dns-search "pm.user.hu" \ ipv4.gateway "192.168.173.254" \ ipv4.method "manual" \ ipv4.routes "10.228.0.0/16 192.168.173.1, 192.168.42.0/24 192.168.173.1" \ - ipv6.method "ignore" + ipv6.method "ignore" \ + save yes + nmcli connection show diff --git a/sources/xfr.pm.f29/firstboot/01_setupnetworking.sh b/sources/xfr.pm.f29/firstboot/01_setupnetworking.sh index 0f20011..c36534e 100755 --- a/sources/xfr.pm.f29/firstboot/01_setupnetworking.sh +++ b/sources/xfr.pm.f29/firstboot/01_setupnetworking.sh @@ -13,42 +13,43 @@ do systemctl --quiet is-active NetworkManager.service NM_RC=$? done -[ $WAITED -ne 0 ] && echo +[ $WAITED -eq 1 ] && echo -CONNECTIONS=$(nmcli connection show | grep -v '^NAME' | wc -l) -if [ $CONNECTIONS -ne 1 ] -then +CONNECTIONS=$(nmcli --terse connection show | wc -l) +while [ $CONNECTIONS -ne 1 ] +do echo "Number of connections: $CONNECTIONS" >&2 - exit 1 -fi - -CONNECTION_LINE=$(nmcli connection show | grep -v '^NAME') -CONNECTION_TOKENS=$(echo $CONNECTION_LINE | wc -w) -#CONNECTION_NAME_POS=$(( $CONNECTION_TOKENS - 3 )) -CONNECTION_UUID_POS=$(( $CONNECTION_TOKENS - 2 )) -#CONNECTION_TYPE_POS=$(( $CONNECTION_TOKENS - 1 )) -CONNECTION_DEVICE_POS=$CONNECTION_TOKENS -#CONNECTION_NAME=$(echo $CONNECTION_LINE \ -# | cut -f -$CONNECTION_NAME_POS -d ' ') -CONNECTION_UUID=$(echo $CONNECTION_LINE \ - | cut -f $CONNECTION_UUID_POS -d ' ') -#CONNECTION_TYPE=$(echo $CONNECTION_LINE \ -# | cut -f $CONNECTION_TYPE_POS -d ' ') -CONNECTION_DEVICE=$(echo $CONNECTION_LINE \ - | cut -f $CONNECTION_DEVICE_POS -d ' ') + sleep 1 + CONNECTIONS=$(nmcli --terse connection show | wc -l) +done + +nmcli --terse connection show | grep ':$' >/dev/null +ALL_CONNECTION_DEVICES_KNOWN=$? +while [ $ALL_CONNECTION_DEVICES_KNOWN -eq 0 ] +do + echo "Not all connection devices are known yet" >&2 + sleep 1 + nmcli --terse connection show | grep ':$' >/dev/null + ALL_CONNECTION_DEVICES_KNOWN=$? +done + +CONNECTION_LINE=$(nmcli --terse connection show) +CONNECTION_UUID=$(echo $CONNECTION_LINE | cut -f 2 -d ':') +CONNECTION_DEVICE=$(echo $CONNECTION_LINE | cut -f 4 -d ':') nmcli connection delete uuid "$CONNECTION_UUID" nmcli connection add \ - type 802-3-ethernet \ - ifname $CONNECTION_DEVICE \ - con-name perimeter \ - autoconnect yes \ - save yes \ + connection.autoconnect yes \ + connection.id perimeter \ + connection.interface-name $CONNECTION_DEVICE \ + connection.type 802-3-ethernet \ ipv4.addresses "192.168.173.251/24" \ ipv4.dns "192.168.173.174" \ ipv4.dns-search "pm.user.hu" \ ipv4.gateway "192.168.173.254" \ ipv4.method "manual" \ - ipv6.method "ignore" + ipv6.method "ignore" \ + save yes + nmcli connection show