Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b46bcd
commit 449baf7
Showing
1 changed file
with
45 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
# | ||
# Cleanup the environment after scope start | ||
# | ||
|
||
PROFILE_SCOPE_SCRIPT="/etc/profile.d/scope.sh" | ||
USR_APPSCOPE_DIR="/usr/lib/appscope/" | ||
TMP_APPSCOPE_DIR="/tmp/appscope/" | ||
|
||
echo "Following script will try to remove following files:" | ||
echo "- $PROFILE_SCOPE_SCRIPT" | ||
echo "- $USR_APPSCOPE_DIR" | ||
echo "- $TMP_APPSCOPE_DIR" | ||
read -p "Continue (y/n)?" choice | ||
case "$choice" in | ||
y|Y ) echo "Yes selected - Continuing";; | ||
n|N ) echo "No selected - Exiting"; exit;; | ||
* ) echo "Unknown choice - Exiting"; exit;; | ||
esac | ||
|
||
if [ "$EUID" -ne 0 ] | ||
then echo "Please run script with sudo" | ||
exit | ||
fi | ||
|
||
if [ -f $PROFILE_SCOPE_SCRIPT ] ; then | ||
rm $PROFILE_SCOPE_SCRIPT | ||
echo "$PROFILE_SCOPE_SCRIPT file was removed" | ||
else | ||
echo "$PROFILE_SCOPE_SCRIPT file was missing. Continue..." | ||
fi | ||
|
||
if [ -d "$USR_APPSCOPE_DIR" ] ; then | ||
rm -r $USR_APPSCOPE_DIR | ||
echo "$USR_APPSCOPE_DIR directory was removed" | ||
else | ||
echo "$USR_APPSCOPE_DIR directory was missing. Continue..." | ||
fi | ||
|
||
if [ -d "$TMP_APPSCOPE_DIR" ] ; then | ||
rm -r $TMP_APPSCOPE_DIR | ||
echo "$TMP_APPSCOPE_DIR directory was removed" | ||
else | ||
echo "$TMP_APPSCOPE_DIR directory was missing." | ||
fi |