diff options
author | Florian Pritz <bluewind@xinu.at> | 2017-07-08 17:50:43 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2017-07-08 17:50:43 +0200 |
commit | 82d62ac42729634a0a7b4e90678ad2fea236df0d (patch) | |
tree | 47406c9bb1e59993eb55e539a8f94af151bb8799 | |
parent | d949010f756df30fa702c3804ba33deda7c33608 (diff) | |
download | bin-82d62ac42729634a0a7b4e90678ad2fea236df0d.tar.gz bin-82d62ac42729634a0a7b4e90678ad2fea236df0d.tar.xz |
Add park-disk
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | park-disk | 6 |
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" |