Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ### BEGIN INIT INFO
- # Provides: firstboot
- # Required-Start: $network
- # Required-Stop:
- # Should-Start:
- # Default-Start: 2
- # Default-Stop: 1
- # Short-Description: firstboot
- # Description: This script runs firstboot which configures network and removes itself
- ### END INIT INFO #
- . /usr/pluto/bin/dvd-installer.sh
- ###########################################################
- ### Setup global variables
- ###########################################################
- LogFile="/var/log/pluto/firstboot.log"
- ###########################################################
- ### Main execution area
- ###########################################################
- #rm /etc/network/interfaces.temp
- #Setup logging
- #. /usr/pluto/bin/TeeMyOutput.sh --outfile "$LogFile" --stdboth --append -- "$@"
- me=$(grep ':1000:1000:' /etc/passwd | cut -d':' -f1)
- homedir=$(grep ':1000:1000' /etc/passwd | cut -d':' -f6)
- if [[ "$FirstBoot" != "false" ]]; then
- cp /etc/network/interfaces.temp /etc/network/interfaces
- /etc/init.d/networking restart
- StatusMessage "Starting firstboot script"
- ConfigSources
- cp -pd /root/new-installer/runners/* /etc/init.d
- StatusMessage "Setting up NICs"
- Nic_Config
- sleep 2
- TimeUpdate
- echo "Configuring NIS" > \$Messg_File
- Setup_NIS
- StatusMessage "Configuring DCERouter"
- Create_And_Config_Devices
- StatusMessage "Installing Asterisk"
- apt-get -y install festival
- apt-get -y install lmce-asterisk
- update-pciids
- StatusMessage "Network configure"
- Configure_Network_Options
- # Our important operations are done. If we chunk out past here we will be ok.
- ConfSet "FirstBoot" "false"
- echo "Setting up TTY options"
- addAdditionalTTYStart
- echo "Fixing EMI"
- TempEMIFix
- StatusMessage "Configuring ssh"
- dpkg-reconfigure openssh-server
- /usr/pluto/bin/SSH_Keys.sh
- StatusMessage "Updating repo's and installing GPG keys"
- gpgUpdate
- echo "/bin/false" > /etc/X11/default-display-manager
- NotifyMessage "Installing Video driver and rebooting"
- /usr/pluto/bin/Start_KDE.sh
- sleep 15
- service kdm stop
- NotifyMessage "Installing Video driver and rebooting"
- CheckVideoDriver
- reboot
- else
- StatusMessage "Setting up DHCP"
- SetupNetworking
- StatusMessage "Cleaning up install"
- CleanInstallSteps
- update-rc.d -f firstboot remove
- rm -f /etc/init.d/firstboot
- if [[ -f /etc/X11/xorg.conf ]]; then
- rm /etc/X11/xorg.conf
- fi
- echo "/bin/false" > /etc/X11/default-display-manager
- StatusMessage "Changing ownership of user directory to '$me'"
- chown -R "$me": "$homedir"
- NotifyMessage "Stage II complete"
- if [[ "$AutostartMedia" == "1" ]]; then
- StatusMessage "The next screen you see should be AVWizard"
- else
- StatusMessage "Headless install finished. You may see some follow up confirm dependency installs before prompt."
- fi
- echo ""
- echo ""
- echo ""
- sleep 3
- fi
Add Comment
Please, Sign In to add comment