mirror of
https://github.com/Ponce/slackbuilds
synced 2024-12-02 13:04:42 +01:00
7300e7bd4d
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
49 lines
1.3 KiB
Bash
49 lines
1.3 KiB
Bash
#!/bin/sh
|
|
# Start/stop/restart pure-ftpd ftp daemon
|
|
|
|
configfile=/etc/pure-ftpd/pure-ftpd.conf
|
|
pidfile=/var/run/pure-ftpd.pid
|
|
|
|
pureftpd_start() {
|
|
if [ -x /usr/sbin/pure-config.pl -a -r "$configfile" ]; then
|
|
echo "Starting pure-ftpd daemon: "
|
|
echo "/usr/sbin/pure-config.pl $configfile"
|
|
/usr/sbin/pure-config.pl $configfile
|
|
fi
|
|
}
|
|
|
|
pureftpd_stop() {
|
|
killall pure-ftpd 2> /dev/null
|
|
/usr/bin/rm $pidfile 2> /dev/null
|
|
}
|
|
|
|
pureftpd_restart() {
|
|
if [ -r "$pidfile" ]; then
|
|
echo "WARNING: killing listener process only. To kill every pure-ftpd process, you must"
|
|
echo " use 'rc.pure-ftpd stop'. 'rc.pure-ftpd restart' kills only the parent pure-ftpd"
|
|
echo " to preserve existing connections. If pure-ftpd has been upgraded, new connections"
|
|
echo " will now use the new version, which should be a safe enough approach."
|
|
kill `cat $pidfile`
|
|
else
|
|
echo "WARNING: There does not appear to be a parent instance of pure-ftpd running."
|
|
echo " If you really want to kill all running instances of pure-ftpd (including"
|
|
echo " any sessions currently in use), run '/etc/rc.d/rc.pure-ftpd stop' instead."
|
|
exit 1
|
|
fi
|
|
sleep 1
|
|
pureftpd_start
|
|
}
|
|
|
|
case "$1" in
|
|
'start')
|
|
pureftpd_start
|
|
;;
|
|
'stop')
|
|
pureftpd_stop
|
|
;;
|
|
'restart')
|
|
pureftpd_restart
|
|
;;
|
|
*)
|
|
echo "usage $0 start|stop|restart"
|
|
esac
|