#!/bin/sh
#May have to be adjusted.. depending on your normal 'ps' output.

if (ps -fu$USER -F "%c" | grep ftpd | grep -v grep > /dev/null); then
	echo Shutting down ftpd processes
	kill -USR1 `ps -fu$USER -F "%c %p" | grep ftpd | grep -v grep | awk '{print $2}'`
	sleep 5
	echo Killing all ftpd processes
	kill -9 `ps -fu$USER -F "%c %p" | grep ftpd | grep -v grep | awk '{print $2}'`
	echo Done
else
	echo Ftpd is not running
fi

