mirror of
https://github.com/unraid/webgui.git
synced 2026-01-05 09:10:07 -06:00
20 lines
420 B
Bash
Executable File
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
|