#!/bin/sh # samba starter for puppy linux PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin SMBCONF=/etc/opt/samba/smb.conf SMBPATH=/opt/samba/sbin # Check that smb.conf exists. [ -f "$SMBCONF" ] || exit 0 startprog() { pidof $1 &>/devnull && return 1 $SMBPATH/$@ } statusprog() { PIDS=$(pidof $1) && echo "$1 is running (PID=$(echo $PIDS|tr ' ' ','))." || echo "$1 is not running." } start() { startprog smbd -s $SMBCONF startprog nmbd } stop() { killall smbd killall nmbd } case $1 in start) start ;; stop) stop ;; restart) stop start ;; reload) killall -HUP smbd ;; status) statusprog smbd statusprog nmbd ;; *) echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}" exit 1 esac