Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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.
# 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.