Update so after migration we will still try to publish the domain.
[handlervirt.git] / passwdchanger.sh
blobd4e45fe8b49eb7ce5ae6535fbc5b5b1bcdc08d8e
1 #!/bin/bash
3 # Stefan de Konink <dekonink@kinkrsoftware.nl>
4 # Licensed under the GPL v3 or in your opinion any later version
5 #
6 # Usage passwdchanger <imagefile> <passwd>
8 DIR=/tmp/`basename $1`
9 mkdir $DIR &&
10 mount -o loop $1 $DIR &&
11 chroot $DIR /usr/sbin/chpasswd <<-EOT
12 root:$2
13 EOT
14 umount $DIR &&
15 rmdir $DIR