Statistics
| Branch: | Revision:

root / example / hooks / windows / admin_passwd @ 86ddc018

History | View | Annotate | Download (521 Bytes)

1
#!/bin/bash
2

    
3
set -e
4
. common.sh
5
. common_windows.sh
6

    
7
debug set -x
8

    
9
CLEANUP=( )
10

    
11
NEW_UNATTEND=`mktemp` || exit 1
12
CLEANUP+=("rm $NEW_UNATTEND")
13

    
14
echo -n "Executing admin_passwd hook..."
15

    
16
NAMESPACE="urn:schemas-microsoft-com:unattend"
17

    
18
$XMLSTARLET ed -N x=$NAMESPACE -u "/x:unattend/x:settings/x:component/x:UserAccounts/x:AdministratorPassword/x:Value" -v $IMG_PASSWD "$TARGET/Unattend.xml" > $NEW_UNATTEND
19

    
20
cat $NEW_UNATTEND > "$TARGET/Unattend.xml"
21

    
22
echo "done"
23

    
24
# execute cleaups
25
cleanup
26
trap - EXIT
27

    
28
echo "done"
29
exit 0