25.12.2013, 20:42
|
#11
|
Member
Регистрация: 15.12.2013
Сообщений: 31
Вес репутации: 0
|
Re: Прошивка CyberWrt для начинающих и опытных пользователей
вот
Цитата:
#!/bin/sh
APP=mjpg_streamer
CMD_LINE=-i "input_uvc.so -d /dev/video0" -o "output_file.so -f /mnt/Yandex/ -d 15000"
PINGIP=8.8.8.8
LSPS=$(pgrep -l $APP | grep -om1 "$APP")
while true ; do
sleep 5
ping -c 2 -s 10 -q "$PINGIP" >/dev/null
if [ $? = 1 ]; then
sleep 5
else
if [ "$LSPS" == "$APP" ] ; then
killall -9 $APP >/dev/null 2>/dev/null
$APP $CMD_LINE &
break
exit 0
else
$APP $CMD_LINE &
break
exit 0
fi
fi
done
|
|
|
|