DSL Tips and Tricks :: samba.unc script



This script installs samba.unc (if not already installed), copies over your password and smb.conf file, and starts, stops, or restarts the samba service.  Edit the paths to samba.unc, smbpasswd, and smb.config.  Runs with args: start, stop, or restart (eg. "samba start")  note: check manual for setting up password and config file.

----------------
#!/bin/bash


if [ ! -f /usr/sbin/nmbd ]; then
mydsl-load /mnt/hda3/Downloads/samba.unc
sudo cp /mnt/hda3/MyFiles/scripts/samba/smb.conf /etc/samba/
sudo cp /mnt/hda3/MyFiles/scripts/samba/smbpasswd /usr/bin/
fi

case $1 in
start )  sudo /usr/sbin/nmbd start | sudo /usr/sbin/smbd start ;;
restart )  sudo /usr/sbin/nmbd restart | sudo /usr/sbin/smbd restart ;;
stop ) sudo killall -TERM nmbd | sudo killall -TERM smbd ;;
* ) echo "args: start, stop, restart" ;;
esac

I edited the [ ! /opt/samba ] after finding this directory loads without samba.unc installed.  /usr/sbin/nmbd installs after samba.unc loads.

original here.