Listing 1. initscript
# Check that networking is up.
[ ${NETWORKING} = "no" ] exit 0
# See how we were called.
case "$1" in
start)
# This example deals with SMB shares-modify to
# suit your configuration, perhaps using automount
# or another facility. Anything to ensure your
# remote and local file systems are remounted
# after a reboot.
echo -n "Mounting SMB shares..."
echo "Mounting share1"
# See the smbmount man page for meaning of flags
/usr/sbin/smbmount //hostname/share \
/home/ftp/mountpoint -n -uftp -gftp \
-f755 -Ihostnames_IP_address
# mount your other shares
echo ""
;;
stop)
echo -n "Umounting SMB shares..."
/usr/sbin/umount /home/ftp/mountpoint
#insert other mount comments here ....
echo ""
;;
*)
echo "Usage: hallways {start|stop}"
exit 1
esac
Copyright © 1994 - 2018 Linux Journal. All rights reserved.