#!/usr/local/bin/bash
root=/server/svnroot #仓库目录
host="192.168.10.111" #host地址用空格分开
pid=`netstat -an | grep '.3690'`
runsvn()
{
for i in $* ; do
/usr/local/bin/svnserve -d -r $root --listen-host=$i
done
}
case $1 in
start)
if [ -z "$pid" ]; then
echo "start..."
runsvn $host
echo "ok"
else
echo "already start"
fi
;;
stop)
if [ -n "$pid" ]; then
echo "stop..."
killall svnserve
echo "ok"
else
echo "no start"
fi
;;
restart)
if [ -n "$pid" ]; then
echo "restart..."
killall svnserve
runsvn $host
echo "ok"
else
echo "no start"
fi
;;
*)
echo "svnd (start|stop|restart)"
esac
root=/server/svnroot #仓库目录
host="192.168.10.111" #host地址用空格分开
pid=`netstat -an | grep '.3690'`
runsvn()
{
for i in $* ; do
/usr/local/bin/svnserve -d -r $root --listen-host=$i
done
}
case $1 in
start)
if [ -z "$pid" ]; then
echo "start..."
runsvn $host
echo "ok"
else
echo "already start"
fi
;;
stop)
if [ -n "$pid" ]; then
echo "stop..."
killall svnserve
echo "ok"
else
echo "no start"
fi
;;
restart)
if [ -n "$pid" ]; then
echo "restart..."
killall svnserve
runsvn $host
echo "ok"
else
echo "no start"
fi
;;
*)
echo "svnd (start|stop|restart)"
esac