mkbackup-btrfs/files/etc/systemd/system/scripts/btrfs-action.sh

9 lines
180 B
Bash
Raw Normal View History

2019-03-05 13:20:31 +01:00
#!/bin/sh
DEVICE="$1"; shift
ACTION="$1"; shift
MAINPID="$1"
[ x"$MAINPID" = "x" ] && exit 0
/bin/ps h -o command -p "$MAINPID" && /sbin/btrfs $ACTION cancel "$DEVICE" || exit 0