Add nfs check
This commit is contained in:
parent
cb735a01a1
commit
cfb189a8cd
@ -60,8 +60,20 @@ check_for_valid_backup_location() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_nfs_mount() {
|
||||||
|
if ! findmnt -rno SOURCE,TARGET,FSTYPE $1 | grep -q nfs; then
|
||||||
|
echo -e "${IRED}$1 is not an active NFS mount.${NO_COLOR}"
|
||||||
|
read -p "Do you want to continue without an active NFS mount? [y/N] " input
|
||||||
|
case $input in
|
||||||
|
[Yy]) return 0 ;;
|
||||||
|
[Nn]|*) exit 1 ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if [ $BACKUP_LOCATION ]; then
|
if [ $BACKUP_LOCATION ]; then
|
||||||
check_for_valid_backup_location "$BACKUP_LOCATION"
|
check_for_valid_backup_location "$BACKUP_LOCATION"
|
||||||
|
check_nfs_mount "$BACKUP_LOCATION"
|
||||||
else
|
else
|
||||||
echo -e "${IRED}No BACKUP_LOCATION in $HOME/.config/update.conf specified${NO_COLOR}"
|
echo -e "${IRED}No BACKUP_LOCATION in $HOME/.config/update.conf specified${NO_COLOR}"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user