Disable system-info service when WSL is detected

This commit is contained in:
Kenneth Benzie 2021-07-11 14:06:22 +01:00
parent 4b2e867721
commit 21d1935ef3
2 changed files with 13 additions and 5 deletions

View File

@ -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
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

View File

@ -4,6 +4,10 @@ if [ `uname` = Darwin ]; then
launchctl unload ~/Library/LaunchAgents/system-info.plist
rm ~/Library/LaunchAgents/system-info.plist
else
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