rename sh files

This commit is contained in:
2023-07-11 09:19:20 +00:00
parent b352256b9f
commit abfbeb2291
2 changed files with 6 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ OSTYPE|PATH|PIPESTATUS|POSIXLY_CORRECT|PPID|PS1|PS4|\
SHELL|SHELLOPTS|SHLVL|SYSTEMD_PID|UID|USER|_)(=|\$)" > "$HOME/.systemd-env"
export PRE_NAMESPACE_PATH="$PATH"
export PRE_NAMESPACE_PWD="$(pwd)"
exec $SUDO_CMD /usr/local/bin/enter-systemd-namespace.sh "$BASH_EXECUTION_STRING"
exec $SUDO_CMD /usr/local/bin/enter-systemd-namespace "$BASH_EXECUTION_STRING"
fi
if [ -n "$PRE_NAMESPACE_PATH" ]; then
export PATH="$PRE_NAMESPACE_PATH"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
if [ "$1" != "--force" ]; then
if [ -f /usr/local/bin/start-systemd-namespace.sh ]; then
if [ -f /usr/local/bin/start-systemd-namespace ]; then
echo "It appears you have already installed the systemd hack."
echo "To forcibly reinstall, run this script with the \`--force\` parameter."
exit
@@ -55,7 +55,9 @@ $SUDO_CMD apt-get update && $SUDO_CMD apt-get install -yqq daemonize dbus-user-s
#$SUDO_CMD cp "$self_dir/start-systemd-namespace" /start-systemd-namespace
#$SUDO_CMD cp "$self_dir/enter-systemd-namespace" /enter-systemd-namespace
$SUDO_CMD chmod +x /usr/local/bin/enter-systemd-namespace.sh
$SUDO_CMD mv /usr/local/bin/start-systemd-namespace.sh /usr/local/bin/start-systemd-namespace
$SUDO_CMD mv /usr/local/bin/enter-systemd-namespace.sh /usr/local/bin/enter-systemd-namespace
$SUDO_CMD chmod +x /usr/local/bin/enter-systemd-namespace
$SUDO_CMD tee /etc/sudoers.d/systemd-namespace >/dev/null <<EOF
Defaults env_keep += WSLPATH
@@ -64,7 +66,7 @@ Defaults env_keep += WSL_INTEROP
Defaults env_keep += WSL_DISTRO_NAME
Defaults env_keep += PRE_NAMESPACE_PATH
Defaults env_keep += PRE_NAMESPACE_PWD
%sudo ALL=(ALL) NOPASSWD: /usr/local/bin/enter-systemd-namespace.sh
%sudo ALL=(ALL) NOPASSWD: /usr/local/bin/enter-systemd-namespace
EOF
if ! grep 'start-systemd-namespace' /etc/bash.bashrc >/dev/null; then