Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 7th, 2013  |  syntax: None  |  size: 0.61 KB  |  views: 38  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2. echo "Please enter the new hostname for this server:"
  3. read hostname
  4. sed -i "s/new-arch-vm/$hostname/g" /etc/hosts
  5. sed -i "s/new-arch-vm/$hostname/g" /etc/hostname
  6.  
  7. rm -f /etc/ssh/ssh_host*
  8. ssh-keygen -A
  9.  
  10. e2label /dev/disk/by-label/root ${hostname}-root
  11. sed -i "s/LABEL=root/LABEL=${hostname}-root/" /etc/fstab
  12. sed -i "s/LABEL=root/LABEL=${hostname}-root/" /boot/syslinux/syslinux.cfg
  13. syslinux-install_update -iam
  14. mkinitcpio -p linux
  15. systemctl enable collectd
  16.  
  17. sed -i "s#/firstboot.sh##g" /root/.zshrc-addon
  18. mv /firstboot.sh /tmp
  19. echo "Press enter to reboot now, or ctrl+c to exit"
  20. read
  21. reboot
clone this paste RAW Paste Data