Advertisement
Guest User

Untitled

a guest
Dec 7th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement