Skip to content

Commit

Permalink
Minor fixes in shell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
roleoroleo committed Apr 13, 2021
1 parent ad9ec17 commit fc8eb09
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/static/static/yi-hack/script/system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,12 @@ if [[ $(get_config ONVIF_WM_SNAPSHOT) == "yes" ]] ; then
fi

if [[ $(get_config RTSP) == "yes" ]] ; then
RRTSP_MODEL=$MODEL_SUFFIX RRTSP_RES=$(get_config RTSP_STREAM) RRTSP_AUDIO=$(get_config RTSP_AUDIO) RRTSP_PORT=$RTSP_PORT RRTSP_USER=$USERNAME RRTSP_PWD=$PASSWORD rRTSPServer &
RTSP_AUDIO_COMPRESSION=$(get_config RTSP_AUDIO)
if [[ "$RTSP_AUDIO_COMPRESSION" == "none" ]] ; then
RTSP_AUDIO_COMPRESSION="no"
fi

RRTSP_MODEL=$MODEL_SUFFIX RRTSP_RES=$(get_config RTSP_STREAM) RRTSP_AUDIO=$RTSP_AUDIO_COMPRESSION RRTSP_PORT=$RTSP_PORT RRTSP_USER=$USERNAME RRTSP_PWD=$PASSWORD rRTSPServer &
if [[ $(get_config RTSP_STREAM) == "low" ]]; then
ONVIF_PROFILE_1="--name Profile_1 --width 640 --height 360 --url rtsp://%s$D_RTSP_PORT/ch0_1.h264 --snapurl http://%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=low$WATERMARK --type H264"
fi
Expand Down
7 changes: 6 additions & 1 deletion src/static/static/yi-hack/script/wd_rtsp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ get_config()

restart_rtsp()
{
RRTSP_MODEL=$MODEL_SUFFIX RRTSP_RES=$(get_config RTSP_STREAM) RRTSP_AUDIO=$(get_config RTSP_AUDIO) RRTSP_PORT=$RTSP_PORT RRTSP_USER=$USERNAME RRTSP_PWD=$PASSWORD rRTSPServer &
RRTSP_MODEL=$MODEL_SUFFIX RRTSP_RES=$(get_config RTSP_STREAM) RRTSP_AUDIO=$RTSP_AUDIO_COMPRESSION RRTSP_PORT=$RTSP_PORT RRTSP_USER=$USERNAME RRTSP_PWD=$PASSWORD rRTSPServer &
}

check_rtsp()
Expand Down Expand Up @@ -77,6 +77,11 @@ case $(get_config RTSP_PORT) in
*) RTSP_PORT=$(get_config RTSP_PORT) ;;
esac

RTSP_AUDIO_COMPRESSION=$(get_config RTSP_AUDIO)
if [[ "$RTSP_AUDIO_COMPRESSION" == "none" ]] ; then
RTSP_AUDIO_COMPRESSION="no"
fi

echo "$(date +'%Y-%m-%d %H:%M:%S') - Starting RTSP watchdog..." >> $LOG_FILE

while true
Expand Down
18 changes: 16 additions & 2 deletions src/www/httpd/cgi-bin/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,25 @@ init_config()
if [[ $HTTPD_PORT != "80" ]] ; then
D_HTTPD_PORT=:$HTTPD_PORT
fi

if [[ $(get_config RTSP) == "yes" ]] ; then
RTSP_AUDIO_COMPRESSION=$(get_config RTSP_AUDIO)
if [[ "$RTSP_AUDIO_COMPRESSION" == "none" ]]; then
RTSP_AUDIO_COMPRESSION="no"
fi
fi
}

start_rtsp()
{
RRTSP_MODEL=$MODEL_SUFFIX RRTSP_RES=$1 RRTSP_PORT=$RTSP_PORT RRTSP_USER=$USERNAME RRTSP_PWD=$PASSWORD rRTSPServer >/dev/null &
if [ ! -z $1 ]; then
RTSP_RES=$1
fi
if [ ! -z $2 ]; then
RTSP_AUDIO_COMPRESSION=$2
fi

RRTSP_MODEL=$MODEL_SUFFIX RRTSP_RES=$RTSP_RES RRTSP_PORT=$RTSP_PORT RRTSP_USER=$USERNAME RRTSP_PWD=$PASSWORD RRTSP_AUDIO=$RTSP_AUDIO_COMPRESSION rRTSPServer >/dev/null &
$YI_HACK_PREFIX/script/wd_rtsp.sh >/dev/null &
}

Expand Down Expand Up @@ -153,7 +167,7 @@ init_config

if [ "$ACTION" == "start" ] ; then
if [ "$NAME" == "rtsp" ]; then
start_rtsp $PARAM1
start_rtsp $PARAM1 $PARAM2
elif [ "$NAME" == "onvif" ]; then
start_onvif $PARAM1 $PARAM2
elif [ "$NAME" == "wsdd" ]; then
Expand Down

0 comments on commit fc8eb09

Please sign in to comment.