echo "Running Software Installations" # Install Software wget -q -O /dev/null 'http://192.168.200.2/automation/updateKickstartInstallationStatus.php?kickstartInstallationId=32787&securityKey=iojtjqyjqrwktzzgcdxeqbcojaftiuuq&percentComplete=99&message=Completing%20Installation' # Configure Network # Debian will reset the configurations on first boot # Save to a second file, and have a startup script move the file over echo "auto lo" > /etc/network/interfaces2 echo "iface lo inet loopback" >> /etc/network/interfaces2 echo "" >> /etc/network/interfaces2 echo "auto eth0" >> /etc/network/interfaces2 echo "iface eth0 inet static" >> /etc/network/interfaces2 echo "address 0.0.0.0" >> /etc/network/interfaces2 echo "netmask 255.255.255.255" >> /etc/network/interfaces2 echo "" >> /etc/network/interfaces2 echo "auto eth1" >> /etc/network/interfaces2 echo "iface eth1 inet static" >> /etc/network/interfaces2 echo "address 0.0.0.0" >> /etc/network/interfaces2 echo "netmask 255.255.255.255" >> /etc/network/interfaces2 echo "gateway 0.0.0.0" >> /etc/network/interfaces2 # Name Servers echo "dns-search securedservers.com" >> /etc/network/interfaces2 echo "dns-nameservers 174.138.175.115 174.138.175.116" >> /etc/network/interfaces2 echo "nameserver 174.138.175.115" > /etc/resolv.conf echo "nameserver 174.138.175.116" >> /etc/resolv.conf # Startup script echo "mv /etc/network/interfaces2 /etc/network/interfaces" > /root/initializeNetwork.sh echo "service networking restart" >> /root/initializeNetwork.sh echo "mv /etc/rc.local.bu /etc/rc.local" >> /root/initializeNetwork.sh echo "rm /root/initializeNetwork.sh" >> /root/initializeNetwork.sh chmod +x /root/initializeNetwork.sh #Snmpd service installation script #trying to `apt-get install -y snmpd` from here errors out #error is caused when Processing triggers for man-db #system is unable to find a file #handling snmpd install like this now (cat <<'EOF' apt-get install -y snmpd mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig echo 'rocommunity iuhet08532h\nsyslocation "PNAP, SecuredServers"\nsyscontact support@securedservers.com' > /etc/snmp/snmpd.conf sed -i "s/SNMPDOPTS=.*$/SNMPDOPTS='-Lsd -Lf \/dev\/null -u snmp -I -smux -p \/var\/run\/snmpd.pid -c \/etc\/snmp\/snmpd.conf'/" /etc/default/snmpd rm /root/installSnmpd.sh /etc/init.d/snmpd restart EOF ) > /root/installSnmpd.sh chmod +x /root/installSnmpd.sh # Add the startup script to firstboot # Also install snmpd on the startup. cp /etc/rc.local /etc/rc.local.bu echo "#!/bin/sh -e" > /etc/rc.local echo "" >> /etc/rc.local echo "/root/initializeNetwork.sh" >> /etc/rc.local echo "/root/installSnmpd.sh" >> etc/rc.local echo "exit 0" >> /etc/rc.local # All done here wget -T 30 -O /dev/null 'http://192.168.200.2/automation/completeKickstartInstallation.php?kickstartInstallationId=32787&securityKey=iojtjqyjqrwktzzgcdxeqbcojaftiuuq' echo "Done"