#!/bin/bash while true; do running=$(ps -ef | grep "webproxys33" | grep -v "grep") if [ "$running" ]; then sleep 2 else mv -f $PWD/webproxys33.out $PWD/../wproxys33.out echo "starting service ..." nohup $PWD/webproxys33 > $PWD/webproxys33.out 2>&1 & fi done