Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

a small sh/bash function script to control samba daemons on Mac OS-X Mountain Lion. note that this startup script is useful only when you install samba with homebrew.

View .bashrc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
# created by Sheutettz Nogami on 2012/09/22.
#
# This script is in the public domain. No claim of ownership is made to any part of the code.
# You can do anything you want with it at your own risk.
 
SAMBA_VERSION=3.6.7
 
samba_control()
{
case $1 in
'start')
\echo "Starting smbd..."
\sudo smbd -D
\echo "Starting nmbd..."
\sudo nmbd -D
;;
'stop')
\echo "Stopping smbd and nmbd..."
for Pid in $(\pgrep smbd); do
\sudo kill -KILL $Pid;
done;
for Pid in $(\pgrep nmbd); do
\sudo kill -KILL $Pid;
done;
\sudo rm -f /usr/local/Cellar/samba/$SAMBA_VERSION/var/locks/smbd.pid
\sudo rm -f /usr/local/Cellar/samba/$SAMBA_VERSION/var/locks/nmbd.pid
;;
*)
\echo "usage: samba_control {start|stop}"
;;
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.