-
-
Notifications
You must be signed in to change notification settings - Fork 728
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhanced scripts/install-slim.sh to accept optional release version, …
…added scripts/uninstall-slim.sh for quick uninstalls Signed-off-by: Kyle Quest <kcq.public@gmail.com>
- Loading branch information
Showing
2 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
function uninstall_slim() { | ||
local VER="" | ||
|
||
# /usr/local/bin should be present on Linux and macOS hosts. Just be sure. | ||
if [ -d /usr/local/bin ]; then | ||
VER=$(slim --version | cut -d'|' -f3) | ||
echo " - Uninstalling version - ${VER}" | ||
|
||
echo " - Removing slim slim binaries from /usr/local/bin" | ||
rm /usr/local/bin/slim | ||
rm /usr/local/bin/slim-sensor | ||
|
||
echo " - Removing local state directory" | ||
rm -rfv /tmp/slim-state | ||
|
||
echo " - Removing state volume" | ||
docker volume rm slim-state | ||
|
||
echo " - Removing sensor volume" | ||
docker volume rm slim-sensor.${VER} | ||
else | ||
echo "ERROR! /usr/local/bin is not present. Uninstall aborted." | ||
exit 1 | ||
fi | ||
} | ||
|
||
echo "Slim scripted uninstall" | ||
|
||
if [ "$(id -u)" -ne 0 ]; then | ||
echo "ERROR! You must run this script as root." | ||
exit 1 | ||
fi | ||
|
||
uninstall_slim |