|
@@ -54,21 +54,33 @@ function install_static_network {
|
54
|
54
|
if [[ $INSTALLING_ON_BBB == "yes" ]]; then
|
55
|
55
|
return
|
56
|
56
|
fi
|
57
|
|
- if [ ! $LOCAL_NETWORK_STATIC_IP_ADDRESS ]; then
|
58
|
|
- return
|
59
|
|
- fi
|
60
|
57
|
|
61
|
58
|
echo '# This file describes the network interfaces available on your system' > /etc/network/interfaces
|
62
|
59
|
echo '# and how to activate them. For more information, see interfaces(5).' >> /etc/network/interfaces
|
63
|
60
|
echo 'source /etc/network/interfaces.d/*' >> /etc/network/interfaces
|
64
|
61
|
|
|
62
|
+ if [ ! $LOCAL_NETWORK_STATIC_IP_ADDRESS ]; then
|
|
63
|
+
|
|
64
|
+ { echo 'auto eth0';
|
|
65
|
+ echo 'iface eth0 inet dhcp'; } > /etc/network/interfaces.d/dynamic
|
|
66
|
+
|
|
67
|
+ if [ -f /etc/network/interfaces.d/static ]; then
|
|
68
|
+ rm /etc/network/interfaces.d/static
|
|
69
|
+ fi
|
|
70
|
+
|
|
71
|
+ mark_completed "${FUNCNAME[0]}"
|
|
72
|
+ return
|
|
73
|
+ fi
|
|
74
|
+
|
65
|
75
|
{ echo 'auto eth0';
|
66
|
76
|
echo 'iface eth0 inet static';
|
67
|
77
|
echo " address $LOCAL_NETWORK_STATIC_IP_ADDRESS";
|
68
|
78
|
echo ' netmask 255.255.255.0';
|
69
|
79
|
echo " gateway $ROUTER_IP_ADDRESS"; } > /etc/network/interfaces.d/static
|
70
|
80
|
|
71
|
|
- mark_completed "${FUNCNAME[0]}"
|
|
81
|
+ if [ -f /etc/network/interfaces.d/dynamic ]; then
|
|
82
|
+ rm /etc/network/interfaces.d/dynamic
|
|
83
|
+ fi
|
72
|
84
|
}
|
73
|
85
|
|
74
|
86
|
function get_external_ipv4_address {
|