debmaker/ressources/smbnetfs-utils/smbnetfs-utils

18 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