summaryrefslogtreecommitdiff
path: root/bin/common
diff options
context:
space:
mode:
Diffstat (limited to 'bin/common')
-rwxr-xr-xbin/common/amount4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/common/amount b/bin/common/amount
index 71fc6ae..9053b62 100755
--- a/bin/common/amount
+++ b/bin/common/amount
@@ -26,7 +26,9 @@ dev="$(grep "^$choice\." "$tmp" | cut -f 2- -d ' ')"
if test -n "$dev"
then
die "mounting /dev/$dev on /media/$dev"
- sudo mount --mkdir /dev/$dev /media/$dev > /dev/null 2>&1 &&
+ test "$(id -u)" != "0" && sudo="sudo"
+ mkdir -p /media/$dev
+ $sudo mount /dev/$dev /media/$dev > /dev/null 2>&1 &&
die 'Mounted succesfully.' ||
die 'Failed to mount.'
die 'Press [Enter] to continue.'