| 1234567891011121314151617181920212223242526272829 |
- #!/bin/bash
- # Licence : GPL v3
- # Author: Laurent HUBERT
- #
- # Example file for first-boot-script
- # Copy this file to a new file and add permission execution to the new file
- # Example:
- # # cp skeleton 02-myscript
- # # chmod +x 02-myscript
- #
- cat <<EOF
- ##############################
- # Changing hostname #
- ##############################
- EOF
- # Example Section : asking user to enter a value
- read -p "Please enter new hostname: " answer
- if [ -n "$answer" ]
- then
- echo Changing hostname to $answer
- current=$(hostname)
- sed -i.firstboot.backup s/$current/$answer/g /etc/hostname
- sed -i.firstboot.backup s/$current/$answer/g /etc/hosts
- exit 0
- else
- # Exit with non zero status
- exit 1
- fi
|