Commit 71fa3598 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Fix a potential bug in windows-legacy

Make sure that the file always contains a "[Commands]" section.
parent 2e9a9bbc
......@@ -156,9 +156,12 @@ elif [ "$SNF_IMAGE_PROPERTY_OSFAMILY" = "windows-legacy" ]; then
mkdir -p "$oemdir"
if [ ! -f "$cmdlinestxt" ]; then
echo "[Commands]" >"$cmdlinestxt"
touch "$cmdlinestxt"
if ! egrep '^[[:space:]]*\[Commands\][[:space:]]*$' "$cmdlinestxt" >/dev/null; then
echo "[Commands]" >> "$cmdlinestxt"
echo '"C:\Windows\SnfScripts\ChangeAdminPassword.cmd"' >>"$cmdlinestxt"
echo '"C:\Windows\Setup\Scripts\SetupComplete.cmd"' >>"$cmdlinestxt"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment