d0f425bcd9284e9696cc4a362d77d13baa6b6ebd
[snf-image] / snf-image-helper / tasks / 40AddDeleteUnattendScript.in
1 #! /bin/bash
2
3 ### BEGIN TASK INFO
4 # Provides:             AddDeleteUnattendScript
5 # RunBefore:            UmountImage
6 # RunAfter:             MountImage
7 # Short-Description:    Script that removes Unattend.xml after setup has finished
8 ### END TASK INFO
9
10 set -e
11 . "@commondir@/common.sh"
12
13 if [ ! -d "$SNF_IMAGE_TARGET" ]; then
14         log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing" 
15 fi
16
17 if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" = "windows" ]; then
18     # Make sure Unattend.xml is removed after setup has finished
19     mkdir -p "$SNF_IMAGE_TARGET/Windows/Setup/Scripts"
20     echo "del /Q /F C:\Unattend.xml" > "$SNF_IMAGE_TARGET/Windows/Setup/Scripts/SetupComplete.cmd"
21 fi
22
23 exit 0
24
25 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :