diff options
-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" |