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

24 lines
507 B
Bash
Executable File

#!/bin/bash
# xfs_check start <dev> <id> <options>
# xfs_check status <dev> <id>
# xfs_check cancel <dev>
# using /var/lib because that's where btrfs puts status
mkdir -p /var/lib/xfs
case "$1" in
'start')
exec /sbin/xfs_repair $4 $2 &> /var/lib/xfs/check.status.$3 &
;;
'status')
if [ -f /var/lib/xfs/check.status.$3 ]; then
cat /var/lib/xfs/check.status.$3
else
echo "Not available"
fi;
pgrep -f "/sbin/xfs_repair.*$2" >/dev/null
;;
'cancel')
pkill -f "/sbin/xfs_repair.*$2"
;;
esac