#!/bin/bash

ss -tunl | grep 8801 &> /dev/null
Z=`echo $?`
if [[ $Z != 0 ]];then
	N=`find /media -name "v7-bityuan"`
	echo $N
	arr=(${N// / })
	num=${#arr[*]}
	echo ${arr[0]}
	if [[ "$num" == "1" ]];then
		echo "v7-bituan is starting"
		chmod +x ${arr[0]}
	        nohup ${arr[0]} &	
	else
		echo "too many node"
	fi
else
	echo "v7-bityuan is running"
fi
