iface lo inet loopback
# The primary network interface
-auto eth0
-iface eth0 inet static
+auto Primary_IF
+iface Primary_IF inet static
address Priv_IP
netmask 255.255.255.0
gateway Priv_NET.1
/etc/init.d/opensrf restart
}
+ConfigNetwork
+
### Setup Monitoring
## Monitored hosts
SetupMonitoring
fi
}
+ConfigNetwork () {
+PRIMARY_IF=$(ip route get 8.8.8.8 | awk '{print $5; exit}')
+if [ ! -z "$PRIMARY_IF" ]; then
+ sed -i "s/Primary_IF/$PRIMARY_IF/g" /etc/network/interfaces
+else
+ echo "ERROR: Unable to set primary interface. You must edit /etc/network/interfaces manually."
+fi
+}
+
### Setup monitoring.
SetupMonitoring () {
## Monitored hosts
echo 'PS1="\[\033[1;33m\]\`if [[ -e /openils/var/web/ldirectorping.txt ]]; then echo "\\[\\033[32m\\]\[Attached\]\\[\\033[0m\\]"; else echo "\\[\\033[31m\\]\[Detached\]\\[\\033[0m\\]"; fi\`\u@\h:\w\\$ "'>> /root/.bashrc
echo 'PS1="\[\033[1;33m\]\`if [[ -e /openils/var/web/ldirectorping.txt ]]; then echo "\\[\\033[32m\\]\[Attached\]\\[\\033[0m\\]"; else echo "\\[\\033[31m\\]\[Detached\]\\[\\033[0m\\]"; fi\`\u@\h:\w\\$ "' >> /home/opensrf/.bashrc
+ConfigNetwork
+
### Setup Monitoring
## Monitored hosts
SetupMonitoring
fi
}
+
### Setup DB #and repoter
DBInstallErr () { ### DB install error.
echo
tar zxvf tar_file.tar.gz -C /
ConfigLogging
+ConfigNetwork