summaryrefslogtreecommitdiffstats
path: root/recipes/clone.sh
blob: e3fc11cf1a78672fd494e6486c20693659edc393 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh -

preimage="$1"
newimage="$2"
root="$3"
nameserver="$4"
hostname="$5"

dd if="$preimage" of="$newimage"

guestfish -a "$newimage" -m "$root" <<EOF
write-file /etc/resolv.conf "nameserver $nameserver" 0
write-file /etc/HOSTNAME "$hostname" 0
sync
EOF