-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
uninstall.command
35 lines (29 loc) · 1009 Bytes
/
uninstall.command
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
### OSx and Linux uninstall commands for the EcoAssist application https://github.com/PetervanLunteren/EcoAssist
### Peter van Lunteren, 17 Jul 2023 (latest edit)
# log
echo
echo Uninstalling EcoAssist...
echo
# check the OS and set var
if [ "$(uname)" == "Darwin" ]; then
if [[ $(sysctl -n machdep.cpu.brand_string) =~ "Apple" ]]; then
PLATFORM="Apple Silicon Mac"
else
PLATFORM="Intel Mac"
fi
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
PLATFORM="Linux"
fi
# set location var
if [ "$PLATFORM" = "Apple Silicon Mac" ] || [ "$PLATFORM" = "Intel Mac" ]; then
LOCATION_ECOASSIST_FILES="/Applications/.EcoAssist_files"
elif [ "$PLATFORM" = "Linux" ]; then
LOCATION_ECOASSIST_FILES="$HOME/.EcoAssist_files"
fi
# delete previous installation of EcoAssist if present so that it can update
rm -rf $LOCATION_ECOASSIST_FILES && echo "Removed dir '${LOCATION_ECOASSIST_FILES}'"
# log
echo
echo Uninstalled EcoAssist. You can close this terminal window.
echo