This repository has been archived on 2022-02-20. You can view files and clone it, but cannot push or open issues/pull-requests.
2020-11-03 12:07:49 -08:00
|
|
|
#!/bin/bash
|
|
|
|
# must have fuser and bindfs installed
|
2020-11-06 14:24:10 -08:00
|
|
|
function bmount () {
|
2020-11-03 12:07:49 -08:00
|
|
|
if [ "$1" == "-mp" ]; then
|
|
|
|
MOUNTED=$(mountpoint "$2" | grep not)
|
|
|
|
if [ -z "$MOUNTED" ]; then
|
|
|
|
echo $2 is a mount point so bind mounting $2/$3 to $4
|
|
|
|
notify-send "bind mounting ${2}/${3} to ${4}" --icon=dialog-information -t 2000
|
|
|
|
bindfs "$2/$3" "$4"
|
|
|
|
else
|
|
|
|
notify-send "${2} not a mount point - Unable to bind mount ${2}/${3} to ${4}" --icon=dialog-error -t 2000
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo bind mounting $1 to $2
|
|
|
|
notify-send "bind mounting ${1} to ${2}" --icon=dialog-information -t 2000
|
|
|
|
bindfs "$1" "$2"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-11-06 14:24:10 -08:00
|
|
|
bumount () {
|
2020-11-03 12:07:49 -08:00
|
|
|
echo "removing bind mount at $1"
|
|
|
|
notify-send "removing bind mount at ${1}" --icon=dialog-information -t 2000
|
|
|
|
fusermount -u "$1"
|
|
|
|
}
|