Files
webgui/emhttp/plugins/dynamix/scripts/btrfs_balance
Tom Mortensen f9ec00b488 repo reorg
2023-06-02 12:49:33 -07:00

20 lines
420 B
Bash
Executable File

#!/bin/bash
# btrfs_balance start <dev> <options>
# btrfs_balance status <dev>
# btrfs_balance cancel <dev>
case "$1" in
'start')
options=$3
[[ -z "${options// }" ]] && options="--full-balance"
exec /sbin/btrfs balance start $options $2 &>/dev/null &
;;
'status')
/sbin/btrfs balance status $2
/sbin/btrfs balance status $2 | grep -q running
;;
'cancel')
/sbin/btrfs balance cancel $2 &>/dev/null
;;
esac