Updated mount declaration to get mount point via findmnt rather than hard coding
This commit is contained in:
parent
28f22c7a8d
commit
467c37362c
1 changed files with 5 additions and 12 deletions
|
|
@ -13,17 +13,10 @@ echo ""
|
|||
# echo "OS we're running on is $OS"
|
||||
source ~/git/shell-scripts/check_os.sh
|
||||
|
||||
if [[ "$OS" =~ .*Solus.* ]]
|
||||
then
|
||||
echo "Setting mount point for Solus"
|
||||
mount_point='/run/media/tracey/LinuxBack'
|
||||
elif [[ "$OS" = "Ubuntu" ]]
|
||||
then
|
||||
echo "Setting mount point for Ubuntu"
|
||||
mount_point='/media/tracey/LinuxBack'
|
||||
else
|
||||
echo "Unknown OS!"
|
||||
fi
|
||||
# Get the mount point by uuid
|
||||
UUID=ff0b3c83-853d-452f-abb6-48069e337446
|
||||
mount_point=`findmnt -rn -S UUID=$UUID -o TARGET`
|
||||
|
||||
echo "Mount point is $mount_point"
|
||||
|
||||
# Check whether target volume is mounted, and mount it if not.
|
||||
|
|
@ -39,7 +32,7 @@ else echo "${mount_point} is already mounted.";
|
|||
fi
|
||||
# Target volume **must** be mounted by this point. If not, die screaming.
|
||||
if ! mountpoint -q ${mount_point}/; then
|
||||
echo "Mounting failed! Cannot run backup without backup volume!"
|
||||
echo "Mounting failed! Cannot run backup without mounted backup volume!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue