debmaker/ressources/smbnetfs-utils/smbnetfs-utils
2024-05-15 10:20:52 +02:00

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