Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify 3.1.0-odbproxyd.sh #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions plugins/obproxy/3.1.0/obproxyd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,24 @@ function start() {
obproxy_path=$path/run/obproxy-$ip-$port.pid

cat $obproxyd_path | xargs kill -9

echo $$ > $obproxyd_path
if [ $? != 0 ]; then
exit $?
fi

pid=`cat $obproxy_path`
echo $pid
ls /proc/$pid > /dev/null
if [ $? != 0 ]; then
exit $?
fi
kill -9 $pid

while [ 1 ];
do
sleep 1
ls /proc/$pid > /dev/null
if [ $? != 0 ]; then
count=`ps -aux | egrep "$path/bin/obproxy --listen_port 2883" | grep -v grep |wc -l`
if [[ $count == 0 ]];then
cd $path
$path/bin/obproxy --listen_port $port
pid=`ps -aux | egrep "$path/bin/obproxy --listen_port $port$" | grep -v grep | awk '{print $2}'`
echo $pid > $obproxy_path
if [ $? != 0 ]; then
exit $?
fi
fi
done
}
Expand All @@ -42,4 +35,6 @@ then
start
else
nohup bash $0 $path $ip $port daemon > /dev/null 2>&1 &
fi

fi