17 lines
566 B
Bash
Executable file
17 lines
566 B
Bash
Executable file
#!/usr/bin/env bash
|
|
source /etc/default/smbnetfs-utils
|
|
|
|
ACTION=$1
|
|
if [ ! -e ${HOME}/${CONF_FILE} ]; then
|
|
echo 'configuration file needed'
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$ACTION" == "" ]; then
|
|
echo 'smbnetfs-utils [mount/unmount]'
|
|
elif [ "$ACTION" == "mount" ]; then
|
|
[ ! -e ${HOME}/${SMBNETFS_MOUNT_POINT} ] && mkdir -p ${HOME}/${SMBNETFS_MOUNT_POINT}
|
|
/usr/bin/smbnetfs -f ${HOME}/${SMBNETFS_MOUNT_POINT} -o config=${HOME}/${CONF_FILE}
|
|
elif [ "$ACTION" == "unmount" ] ; then
|
|
/usr/bin/fusermount -u ${HOME}/${SMBNETFS_MOUNT_POINT}
|
|
fi
|