aboutsummaryrefslogtreecommitdiff
path: root/scripts/install-systemd-multi-user.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/install-systemd-multi-user.sh')
-rwxr-xr-xscripts/install-systemd-multi-user.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/install-systemd-multi-user.sh b/scripts/install-systemd-multi-user.sh
index 62397127a..7dd567747 100755
--- a/scripts/install-systemd-multi-user.sh
+++ b/scripts/install-systemd-multi-user.sh
@@ -24,12 +24,17 @@ $1
EOF
}
+escape_systemd_env() {
+ temp_var="${1//\'/\\\'}"
+ echo "${temp_var//\%/%%}"
+}
+
# Gather all non-empty proxy environment variables into a string
create_systemd_proxy_env() {
vars="http_proxy https_proxy ftp_proxy no_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY NO_PROXY"
for v in $vars; do
if [ "x${!v:-}" != "x" ]; then
- echo "Environment=${v}=${!v}"
+ echo "Environment=${v}=$(escape_systemd_env ${!v})"
fi
done
}