aboutsummaryrefslogtreecommitdiff
path: root/trashman
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-11-12 10:41:22 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-11-12 10:41:22 -0200
commit645d61a80759925e187b3a92dd9bb018ab471712 (patch)
tree7b32360e78337c0e43d1546c96b71be6e9277d6b /trashman
parent302339469cdba5cadfb8120350f6075370183b47 (diff)
downloadtrashman-645d61a80759925e187b3a92dd9bb018ab471712.tar.gz
trashman-645d61a80759925e187b3a92dd9bb018ab471712.tar.bz2
Misc enhancements
Diffstat (limited to 'trashman')
-rwxr-xr-xtrashman26
1 files changed, 6 insertions, 20 deletions
diff --git a/trashman b/trashman
index 89546b6..539e15d 100755
--- a/trashman
+++ b/trashman
@@ -78,31 +78,17 @@ else
if [ ! -z "`__trashman_actions $package`" ]; then
folder="`__trashman_actions_folder $package`"
+ # Checking for privileges
+ __trashman_check_root $ACTION
+
if [ -x "$SHARE/$package/$folder/$ACTION" ]; then
if [ "$ACTION" != "check" ] && [ "$ACTION" != "test" ]; then
- __trashman_echo "Dumpsterizing your system: action $ACTION for $package ($folder)..."
+ __trashman_echo "Issuing action $ACTION for $package ($folder)..."
fi
+ # Run action for package
$SHARE/$package/$folder/$ACTION $SHARE
- status="$?"
-
- if [ "$ACTION" = "check" ]; then
- if [ "$status" = "0" ]; then
- __trashman_echo "Package $package is installed system-wide"
- elif [ "$status" = "1" ]; then
- __trashman_echo "Package $package is not installed system-wide"
- elif [ "$status" = "2" ]; then
- __trashman_echo "Package $package is partially installed system-wide"
- fi
- fi
-
- if [ "$ACTION" = "test" ]; then
- if [ "$status" = "0" ]; then
- __trashman_echo "Package $package is running as expected"
- elif [ "$status" = "1" ]; then
- __trashman_echo "Package $package is not running as expected"
- fi
- fi
+ __trashman_check_exit_status $ACTION $?
else
__trashman_echo "No such action $ACTION for package $package, skipping"
fi