mirror of
https://github.com/dockur/windows.git
synced 2026-07-27 21:42:36 +07:00
feat: Add option to disable shared folder shortcuts (#1928)
This commit is contained in:
@@ -105,6 +105,7 @@ An empty default means the variable is unset and its value is determined automat
|
||||
|---|---|---|
|
||||
| `SAMBA` | `Y` | Enables the Samba shared folder. |
|
||||
| `SAMBA_DEBUG` | `N` | Enables Samba debug output. |
|
||||
| `SHORTCUT` | `Y` | Creates desktop and drive shortcuts to the shared folder. |
|
||||
|
||||
## ⚙️ System
|
||||
|
||||
|
||||
@@ -604,6 +604,21 @@ updateXML() {
|
||||
sed -i "s|</UserData>| <ProductKey>\n <Key>$key</Key>\n <WillShowUI>OnError</WillShowUI>\n </ProductKey>\n </UserData>|g" "$asset" || return 1
|
||||
fi
|
||||
|
||||
if disabled "$SHORTCUT" || disabled "$SAMBA"; then
|
||||
if ! sed -i -E '
|
||||
/<SynchronousCommand([[:space:]>])/ {
|
||||
:command
|
||||
N
|
||||
/<\/SynchronousCommand>/!b command
|
||||
/<Description>Create desktop shortcut to shared folder<\/Description>/d
|
||||
/<Description>Map shared folder<\/Description>/d
|
||||
}
|
||||
' "$asset"; then
|
||||
error "Failed to remove shared folder shortcuts from answer file!"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! xmllint --nonet --noout "$asset"; then
|
||||
error "The generated answer file is not valid XML!"
|
||||
return 1
|
||||
|
||||
+1
-1
@@ -18,6 +18,7 @@ set -Eeuo pipefail
|
||||
: "${LANGUAGE:=""}"
|
||||
: "${USERNAME:=""}"
|
||||
: "${PASSWORD:=""}"
|
||||
: "${SHORTCUT:=""}"
|
||||
: "${DOMAIN_OU:=""}"
|
||||
: "${WORKGROUP:=""}"
|
||||
: "${AUTOLOGIN:=""}"
|
||||
@@ -36,7 +37,6 @@ LANGUAGE=$(strip "$LANGUAGE")
|
||||
USERNAME=$(strip "$USERNAME")
|
||||
DOMAIN_OU=$(strip "$DOMAIN_OU")
|
||||
WORKGROUP=$(strip "$WORKGROUP")
|
||||
AUTOLOGIN=$(strip "$AUTOLOGIN")
|
||||
|
||||
MIRRORS=3
|
||||
|
||||
|
||||
Reference in New Issue
Block a user