From 21d1935ef336cdac033e6da05d55ab9eec0bdfb6 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Sun, 11 Jul 2021 14:06:22 +0100 Subject: [PATCH] Disable system-info service when WSL is detected --- system-info/install.sh | 10 +++++++--- system-info/remove.sh | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/system-info/install.sh b/system-info/install.sh index 4dd5e9f..daaa97c 100755 --- a/system-info/install.sh +++ b/system-info/install.sh @@ -6,7 +6,11 @@ if [ `uname` = Darwin ]; then cp $script_dir/system-info.plist ~/Library/LaunchAgents/system-info.plist launchctl load -w ~/Library/LaunchAgents/system-info.plist else - cp $script_dir/system-info.service ~/.config/systemd/user/system-info.service - systemctl --user enable system-info - systemctl --user start system-info + if [ "$WSL_DISTRO_NAME" = "" ]; then + cp $script_dir/system-info.service ~/.config/systemd/user/system-info.service + systemctl --user enable system-info + systemctl --user start system-info + else + echo -e "\033[0;33mwarning:\033[0m WSL detected, system-info systemd service disabled" + fi fi diff --git a/system-info/remove.sh b/system-info/remove.sh index 872bef0..070b17c 100755 --- a/system-info/remove.sh +++ b/system-info/remove.sh @@ -4,6 +4,10 @@ if [ `uname` = Darwin ]; then launchctl unload ~/Library/LaunchAgents/system-info.plist rm ~/Library/LaunchAgents/system-info.plist else - systemctl --user stop system-info - systemctl --user disable system-info + if [ "$WSL_DISTRO_NAME" = "" ]; then + systemctl --user stop system-info + systemctl --user disable system-info + else + echo -e "\033[0;33mwarning:\033[0m WSL detected, system-info systemd service disabled" + fi fi