|
@@ -1,12 +1,10 @@
|
|
|
#!/bin/bash
|
|
#!/bin/bash
|
|
|
wd_c=0
|
|
wd_c=0
|
|
|
-free_c=0
|
|
|
|
|
-time_wait_c=0
|
|
|
|
|
start()
|
|
start()
|
|
|
{
|
|
{
|
|
|
while [ 1 ]
|
|
while [ 1 ]
|
|
|
do
|
|
do
|
|
|
- HTTPD_STAT="`ps|grep speaker-cgi|grep -v grep`"
|
|
|
|
|
|
|
+ HTTPD_STAT="`ps -e|grep speaker-cgi|grep -v grep`"
|
|
|
if [ -z "${HTTPD_STAT}" ];then
|
|
if [ -z "${HTTPD_STAT}" ];then
|
|
|
killall speaker-cgi > /dev/null 2>&1
|
|
killall speaker-cgi > /dev/null 2>&1
|
|
|
sleep 1
|
|
sleep 1
|
|
@@ -14,102 +12,28 @@ start()
|
|
|
wd_c=`expr $wd_c + 1`
|
|
wd_c=`expr $wd_c + 1`
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
- APIAGENT_STAT="`ps|grep api_agent|grep -v grep`"
|
|
|
|
|
- if [ -z "${APIAGENT_STAT}" ];then
|
|
|
|
|
- /etc/scripts/api_agent &
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
- AICTRL_STAT="`ps|grep serial_ctrl|grep -v grep`"
|
|
|
|
|
- if [ -z "${AICTRL_STAT}" ];then
|
|
|
|
|
- HWVer="`sysconf /etc/speaker.conf get system hard_version`"
|
|
|
|
|
- if [ ${HWVer:3:1} -ge 3 ];then
|
|
|
|
|
- /etc/scripts/shell_action.sh ai start
|
|
|
|
|
- fi
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ # APIAGENT_STAT="`ps|grep api_agent|grep -v grep`"
|
|
|
|
|
+ # if [ -z "${APIAGENT_STAT}" ];then
|
|
|
|
|
+ # /etc/scripts/api_agent &
|
|
|
|
|
+ # fi
|
|
|
|
|
|
|
|
- REDIS_STAT="`ps|grep 'redis-server'|grep -v grep`"
|
|
|
|
|
|
|
+ REDIS_STAT="`ps -e|grep 'redis-server'|grep -v grep`"
|
|
|
if [ -z "${REDIS_STAT}" ];then
|
|
if [ -z "${REDIS_STAT}" ];then
|
|
|
/usr/sbin/redis-server /etc/redis.conf > /dev/null 2>&1 &
|
|
/usr/sbin/redis-server /etc/redis.conf > /dev/null 2>&1 &
|
|
|
wd_c=`expr $wd_c + 1`
|
|
wd_c=`expr $wd_c + 1`
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
- OUTPUTCTRL_STAT="`ps|grep output_control|grep -v grep`"
|
|
|
|
|
- if [ -z "${OUTPUTCTRL_STAT}" ];then
|
|
|
|
|
- /etc/scripts/output_control &
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
- PROCESS_STAT="`ps|grep service_process|grep -v grep`"
|
|
|
|
|
- if [ -z "${PROCESS_STAT}" ];then
|
|
|
|
|
- /etc/scripts/service_process &
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
- ISPEAKER_STAT="`ps|grep -w "python3 /app/ispeaker-service/ispeaker" |grep -v grep`"
|
|
|
|
|
- if [ -z "${ISPEAKER_STAT}" ];then
|
|
|
|
|
- ISPEAKER_ENABLE="`sysconf /etc/speaker.conf get system broadcast_service`"
|
|
|
|
|
- SIP_ENABLE="`sysconf /etc/speaker.conf get account_info_1 enable`"
|
|
|
|
|
- MULTICAST_ENABLE="`sysconf /etc/speaker.conf get multicast_player enable`"
|
|
|
|
|
- if [ "foo${ISPEAKER_ENABLE}" = "fooyes" -a "foo${SIP_ENABLE}" = "fooyes" ] || [ "foo${MULTICAST_ENABLE}" = "fooyes" ];then
|
|
|
|
|
- if [ "foo${ISPEAKER_ENABLE}" = "fooyes" -a "foo${SIP_ENABLE}" = "fooyes" ];then
|
|
|
|
|
- killall ptpd2 > /dev/null 2>&1
|
|
|
|
|
- /etc/scripts/shell_action.sh startSyncTimeToIPAC
|
|
|
|
|
- else
|
|
|
|
|
- killall ptpd2 > /dev/null 2>&1
|
|
|
|
|
- fi
|
|
|
|
|
- killall ispeaker > /dev/null 2>&1
|
|
|
|
|
- # sleep 1
|
|
|
|
|
- /etc/scripts/ispeaker start
|
|
|
|
|
- wd_c=`expr $wd_c + 1`
|
|
|
|
|
- fi
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
- WAIT_STAT=$(netstat -apn | grep 1883 | awk '{print $6}' | tr -d ' ')
|
|
|
|
|
- if ! echo "$WAIT_STAT" | grep -q "ESTABLISHED" && echo "$WAIT_STAT" | grep -Eq "TIME_WAIT|CLOSE_WAIT|SYN_SENT|FIN_WAIT1"; then
|
|
|
|
|
- time_wait_c=`expr $time_wait_c + 1`
|
|
|
|
|
- if [ $time_wait_c -gt 3 ];then
|
|
|
|
|
- ISPEAKER_ENABLE="`sysconf /etc/speaker.conf get system broadcast_service`"
|
|
|
|
|
- SIP_ENABLE="`sysconf /etc/speaker.conf get account_info_1 enable`"
|
|
|
|
|
- if [ "foo${ISPEAKER_ENABLE}" = "fooyes" -a "foo${SIP_ENABLE}" = "fooyes" ];then
|
|
|
|
|
- killall ispeaker > /dev/null 2>&1
|
|
|
|
|
- sleep 1
|
|
|
|
|
- /etc/scripts/ispeaker start
|
|
|
|
|
- sleep 3
|
|
|
|
|
- time_wait_c=0
|
|
|
|
|
- fi
|
|
|
|
|
- fi
|
|
|
|
|
- else
|
|
|
|
|
- time_wait_c=0
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
- PTP_STAT="`ps|grep -w ptpd2|grep -v grep`"
|
|
|
|
|
- if [ -z "${PTP_STAT}" ];then
|
|
|
|
|
- PTP_ENABLE="`sysconf /etc/speaker.conf get ptp enable`"
|
|
|
|
|
- if [ "foo${PTP_ENABLE}" = "fooyes" ];then
|
|
|
|
|
- ISPEAKER_ENABLE="`sysconf /etc/speaker.conf get system broadcast_service`"
|
|
|
|
|
- SIP_ENABLE="`sysconf /etc/speaker.conf get account_info_1 enable`"
|
|
|
|
|
- if [ "foo${ISPEAKER_ENABLE}" = "foono" -o "foo${SIP_ENABLE}" = "foono" ];then
|
|
|
|
|
- killall ptpd2 > /dev/null 2>&1
|
|
|
|
|
- /etc/scripts/shell_action.sh startSyncTimeToPtpServer
|
|
|
|
|
- fi
|
|
|
|
|
- else
|
|
|
|
|
- ISPEAKER_ENABLE="`sysconf /etc/speaker.conf get system broadcast_service`"
|
|
|
|
|
- SIP_ENABLE="`sysconf /etc/speaker.conf get account_info_1 enable`"
|
|
|
|
|
- if [ "foo${ISPEAKER_ENABLE}" = "fooyes" -a "foo${SIP_ENABLE}" = "fooyes" ];then
|
|
|
|
|
- killall ptpd2 > /dev/null 2>&1
|
|
|
|
|
- /etc/scripts/shell_action.sh startSyncTimeToIPAC
|
|
|
|
|
- fi
|
|
|
|
|
- fi
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ # OUTPUTCTRL_STAT="`ps|grep output_control|grep -v grep`"
|
|
|
|
|
+ # if [ -z "${OUTPUTCTRL_STAT}" ];then
|
|
|
|
|
+ # /etc/scripts/output_control &
|
|
|
|
|
+ # fi
|
|
|
|
|
|
|
|
- ONVIFSERVER_STAT="`ps|grep -w onvifserver|grep -v grep`"
|
|
|
|
|
- RTSPSERVER_STAT="`ps|grep -w rtspserver|grep -v grep`"
|
|
|
|
|
- if [ -z "${ONVIFSERVER_STAT}" -o -z "${RTSPSERVER_STAT}" ];then
|
|
|
|
|
- ONVIF_ENABLE="`sysconf /etc/speaker.conf get onvif enable`"
|
|
|
|
|
- if [ "foo${ONVIF_ENABLE}" = "fooyes" ];then
|
|
|
|
|
- /etc/scripts/shell_action.sh set_onvif
|
|
|
|
|
- fi
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ # PROCESS_STAT="`ps|grep service_process|grep -v grep`"
|
|
|
|
|
+ # if [ -z "${PROCESS_STAT}" ];then
|
|
|
|
|
+ # /etc/scripts/service_process &
|
|
|
|
|
+ # fi
|
|
|
|
|
|
|
|
- SIPPHONE_STAT="`ps|grep baresip|grep -v grep`"
|
|
|
|
|
|
|
+ SIPPHONE_STAT="`ps -e|grep baresip|grep -v grep`"
|
|
|
SIPSEV_STAT="`ps|grep 'bareservice'|grep -v grep`"
|
|
SIPSEV_STAT="`ps|grep 'bareservice'|grep -v grep`"
|
|
|
if [ -z "${SIPPHONE_STAT}" -o -z "${SIPSEV_STAT}" ];then
|
|
if [ -z "${SIPPHONE_STAT}" -o -z "${SIPSEV_STAT}" ];then
|
|
|
killall baresip > /dev/null 2>&1
|
|
killall baresip > /dev/null 2>&1
|
|
@@ -119,16 +43,20 @@ start()
|
|
|
wd_c=`expr $wd_c + 1`
|
|
wd_c=`expr $wd_c + 1`
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
- ONVIF_STAT="`ps|grep 'onvif-discover'|grep -v grep`"
|
|
|
|
|
|
|
+ # ONVIFSERVER_STAT="`ps|grep -w onvifserver|grep -v grep`"
|
|
|
|
|
+ # RTSPSERVER_STAT="`ps|grep -w rtspserver|grep -v grep`"
|
|
|
|
|
+ # if [ -z "${ONVIFSERVER_STAT}" -o -z "${RTSPSERVER_STAT}" ];then
|
|
|
|
|
+ # ONVIF_ENABLE="`sysconf /etc/speaker.conf get onvif enable`"
|
|
|
|
|
+ # if [ "foo${ONVIF_ENABLE}" = "fooyes" ];then
|
|
|
|
|
+ # /etc/scripts/shell_action.sh set_onvif
|
|
|
|
|
+ # fi
|
|
|
|
|
+ # fi
|
|
|
|
|
+
|
|
|
|
|
+ ONVIF_STAT="`ps -e|grep 'onvif-discover'|grep -v grep`"
|
|
|
if [ -z "${ONVIF_STAT}" ];then
|
|
if [ -z "${ONVIF_STAT}" ];then
|
|
|
/etc/scripts/onvif-discover > /dev/null 2>&1 &
|
|
/etc/scripts/onvif-discover > /dev/null 2>&1 &
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
- EQ_STAT="`ps|grep 'eq_drc_process'|grep -v grep`"
|
|
|
|
|
- if [ -z "${EQ_STAT}" ];then
|
|
|
|
|
- /usr/bin/eq_drc_process > /dev/null 2>&1 &
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
SPEAKER_CONF_ERROR_STAT="`grep "\['" /oem/etc/speaker.conf`"
|
|
SPEAKER_CONF_ERROR_STAT="`grep "\['" /oem/etc/speaker.conf`"
|
|
|
if [ ! -z "${SPEAKER_CONF_ERROR_STAT}" ];then
|
|
if [ ! -z "${SPEAKER_CONF_ERROR_STAT}" ];then
|
|
|
sed -i "s/\['//g" /oem/etc/speaker.conf
|
|
sed -i "s/\['//g" /oem/etc/speaker.conf
|