Merge remote-tracking branch 'upstream/master'

This commit is contained in:
bergware
2025-04-27 23:28:00 +02:00

View File

@@ -88,11 +88,6 @@ start() {
empty() {
DISK="$1"
if [ ! -d "/mnt/$DISK" ]; then
echo "Error: disk '$DISK' not found"
exit 1
fi
if [ -f $PIDFILE ]; then
if ps h $(cat $PIDFILE) | grep mover ; then
echo "mover: already running"
@@ -151,16 +146,20 @@ stop() {
usage() {
echo "Usage: $0 start [-e <disk_name>]"
echo " $0 stop|status"
echo " <disk_name> must match pattern 'disk[0-9]*'"
echo " <disk_name> must match pattern 'disk[0-9]*' and /mnt/<disk_name> must be a mountpoint"
exit 1
}
# validate disk name
validate_disk() {
if [[ ! "$1" =~ ^disk[0-9]+$ ]]; then
echo "Error: <disk_name> must match pattern 'disk[0-9]*'"
usage
fi
if [[ ! "$1" =~ ^disk[0-9]+$ ]]; then
echo "Error: <disk_name> must match pattern 'disk[0-9]+$'"
usage
fi
if ! mountpoint --nofollow /mnt/$1 > /dev/null 2>&1; then
echo "Error: nothing mounted at /mnt/$1"
usage
fi
}
if [ "$#" -lt 1 ]; then