-
Notifications
You must be signed in to change notification settings - Fork 1
/
hook.sh
executable file
·19 lines (16 loc) · 684 Bytes
/
hook.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
base=$1
target_root_directory=$2
if [ -f "$base/etc/fstab" ]; then
logger "found $base/etc/fstab, processing possible nfs/cifs filesystems"
grep -v "^#" "$base/etc/fstab" |grep -v ^$ |grep -v swap |grep -v tmpfs |grep -v UUID= |grep -v ^/dev/ |while read line; do
FS=`echo "$line" |awk '{ print $3 }'`
if [ "$FS" = "cifs" ] || [ "$FS" = "smbfs" ]; then
/opt/drivebadger/hooks/hook-fstab/handle-cifs.sh "$line" "$base" $target_root_directory &
elif [ "$FS" = "nfs" ] || [ "$FS" = "nfs4" ]; then
/opt/drivebadger/hooks/hook-fstab/handle-nfs.sh "$line" "$base" $target_root_directory &
else
logger "skipping FS=$FS (not implemented: $line)"
fi
done
fi