summaryrefslogtreecommitdiffstats
path: root/park-disk
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-07-08 17:50:43 +0200
committerFlorian Pritz <bluewind@xinu.at>2017-07-08 17:50:43 +0200
commit82d62ac42729634a0a7b4e90678ad2fea236df0d (patch)
tree47406c9bb1e59993eb55e539a8f94af151bb8799 /park-disk
parentd949010f756df30fa702c3804ba33deda7c33608 (diff)
downloadbin-82d62ac42729634a0a7b4e90678ad2fea236df0d.tar.gz
bin-82d62ac42729634a0a7b4e90678ad2fea236df0d.tar.xz
Add park-disk
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'park-disk')
-rw-r--r--park-disk6
1 files changed, 6 insertions, 0 deletions
diff --git a/park-disk b/park-disk
new file mode 100644
index 0000000..f92124d
--- /dev/null
+++ b/park-disk
@@ -0,0 +1,6 @@
+#!/bin/bash
+_sudo=''
+[[ -z "$1" ]] && { echo "Usage: $(basename "$0") <device>"; exit 1; }
+[[ ${UID} -ne 0 ]] && _sudo='sudo'
+
+exec "${_sudo}" udisksctl power-off -b "$1"