Advertisement
teknoraver

prepvm

Nov 19th, 2018
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.58 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. [ -f "$1" ] || exec echo "$1 does not exist"
  4.  
  5. for i in virt-edit guestfish; do
  6.     which "$i" >/dev/null 2>/dev/null || exec echo "$i not found"
  7. done
  8.  
  9. virt-edit -a "$1" /etc/shadow -e 's/^root:[^:]*:/root::/'
  10. guestfish -a "$1" -i rm '/etc/systemd/system/multi-user.target.wants/cloud-config.service'
  11. guestfish -a "$1" -i rm '/etc/systemd/system/multi-user.target.wants/cloud-final.service'
  12. guestfish -a "$1" -i rm '/etc/systemd/system/multi-user.target.wants/cloud-init-local.service'
  13. guestfish -a "$1" -i rm '/etc/systemd/system/multi-user.target.wants/cloud-init.service'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement