daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Dec 16th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. ### BEGIN INIT INFO
  3. # Provides:     firstboot
  4. # Required-Start:   $network
  5. # Required-Stop:     
  6. # Should-Start:
  7. # Default-Start:    2
  8. # Default-Stop:     1
  9. # Short-Description:    firstboot
  10. # Description:      This script runs firstboot which configures network and removes itself
  11. ### END INIT INFO #
  12.  
  13. . /usr/pluto/bin/dvd-installer.sh
  14. ###########################################################
  15. ### Setup global variables
  16. ###########################################################
  17. LogFile="/var/log/pluto/firstboot.log"
  18.  
  19. ###########################################################
  20. ### Main execution area
  21. ###########################################################
  22.  
  23. #rm /etc/network/interfaces.temp
  24. #Setup logging
  25. #. /usr/pluto/bin/TeeMyOutput.sh --outfile "$LogFile" --stdboth --append -- "$@"
  26. me=$(grep ':1000:1000:' /etc/passwd | cut -d':' -f1)
  27. homedir=$(grep ':1000:1000' /etc/passwd | cut -d':' -f6)
  28.  
  29. if [[ "$FirstBoot" != "false" ]]; then
  30.     cp /etc/network/interfaces.temp /etc/network/interfaces
  31.     /etc/init.d/networking restart
  32.     StatusMessage "Starting firstboot script"
  33.     ConfigSources
  34.     cp -pd /root/new-installer/runners/* /etc/init.d
  35.     StatusMessage "Setting up NICs"
  36.     Nic_Config
  37.     sleep 2
  38.     TimeUpdate
  39.     echo "Configuring NIS" > \$Messg_File
  40.     Setup_NIS
  41.     StatusMessage "Configuring DCERouter"
  42.     Create_And_Config_Devices
  43.     StatusMessage "Installing Asterisk"
  44.     apt-get -y install festival
  45.     apt-get -y install lmce-asterisk
  46.     update-pciids
  47.     StatusMessage "Network configure"
  48.     Configure_Network_Options
  49.     # Our important operations are done. If we chunk out past here we will be ok.
  50.     ConfSet "FirstBoot" "false"
  51.     echo "Setting up TTY options"
  52.     addAdditionalTTYStart
  53.     echo "Fixing EMI"
  54.     TempEMIFix
  55.     StatusMessage "Configuring ssh"
  56.     dpkg-reconfigure openssh-server
  57.     /usr/pluto/bin/SSH_Keys.sh
  58.     StatusMessage "Updating repo's and installing GPG keys"
  59.     gpgUpdate
  60.     echo "/bin/false" > /etc/X11/default-display-manager
  61.     NotifyMessage "Installing Video driver and rebooting"
  62.     /usr/pluto/bin/Start_KDE.sh
  63.     sleep 15
  64.     service kdm stop
  65.     NotifyMessage "Installing Video driver and rebooting"
  66.     CheckVideoDriver
  67.     reboot        
  68. else
  69.     StatusMessage "Setting up DHCP"
  70.     SetupNetworking
  71.     StatusMessage "Cleaning up install"
  72.     CleanInstallSteps
  73.     update-rc.d -f firstboot remove
  74.     rm -f /etc/init.d/firstboot
  75.         if [[ -f /etc/X11/xorg.conf ]]; then
  76.             rm /etc/X11/xorg.conf
  77.         fi
  78.     echo "/bin/false" > /etc/X11/default-display-manager
  79.         StatusMessage "Changing ownership of user directory to '$me'"
  80.     chown -R "$me": "$homedir"
  81.     NotifyMessage "Stage II complete"
  82.     if [[ "$AutostartMedia" == "1" ]]; then
  83.         StatusMessage "The next screen you see should be AVWizard"
  84.     else
  85.         StatusMessage "Headless install finished. You may see some follow up confirm dependency installs before prompt."
  86.     fi
  87.     echo ""
  88.     echo ""
  89.     echo ""
  90.     sleep 3
  91. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top