├── repacking └── .dot ├── plugins ├── tg_guard.sh ├── tg_reboot.sh ├── firstboot ├── tg_system.sh ├── tapip ├── tg_relay.sh ├── tg_snap.sh ├── ipcam_mqtt_listner ├── ipcam_tunnel ├── ipcam_wifi ├── ipcam_system ├── ipcam_combine ├── ipcam_tgbot └── ipcam_menu ├── LICENSE └── README.md /repacking/.dot: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /plugins/tg_guard.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Exec /guard command 4 | 5 | echo $(date +%s) >/tmp/guard.lock 6 | echo "Guard alert timeout activated" 7 | -------------------------------------------------------------------------------- /plugins/tg_reboot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Exec /reboot command 4 | 5 | echo "Reboot process started!" 6 | cp /var/tmp/telegram_offset /mnt/mtd/telegram_offset 7 | sleep 2 8 | reboot -------------------------------------------------------------------------------- /plugins/firstboot: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | clear 4 | echo 5 | echo "Remove ModdingIPC configs and reboot device..." 6 | echo 7 | rm -vf /mnt/mtd/ipcam.conf /mnt/mtd/crontabs/root 8 | sleep 1 9 | reboot 10 | -------------------------------------------------------------------------------- /plugins/tg_system.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Exec /system command 4 | 5 | echo "Uptime:" 6 | uptime 7 | echo "" 8 | echo "Memory:" 9 | free | awk '/Mem/ {print "Total: "$2" |","Used: "$3" |","Free: "$4}' 10 | -------------------------------------------------------------------------------- /plugins/tapip: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # ZFT Lab. 2018 | http://zftlab.org/pages/2018010700.html 4 | # Simple script for get IP via UDHCPC on VTUN TAP interface 5 | 6 | 7 | case "$1" in 8 | 9 | deconfig) 10 | ip a flush dev $interface 11 | ;; 12 | 13 | renew|bound) 14 | ip a add $ip/$subnet dev $interface 15 | ;; 16 | 17 | esac 18 | 19 | exit 0 20 | -------------------------------------------------------------------------------- /plugins/tg_relay.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Exec /relay command 4 | 5 | #STATUS=`cat /sys/class/gpio/gpio20/value` 6 | 7 | 8 | if [ "${STATUS}" == "1" ]; then 9 | echo "Relay current ON => turn it to OFF" 10 | #echo "0" >/sys/class/gpio/gpio20/value 11 | else 12 | echo "Relay module not found" 13 | fi 14 | 15 | if [ "${STATUS}" == "0" ]; then 16 | echo "Relay current OFF => turn it to ON" 17 | #echo "1" >/sys/class/gpio/gpio20/value 18 | else 19 | echo "Relay module not found" 20 | fi 21 | -------------------------------------------------------------------------------- /plugins/tg_snap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # ZFT Lab. 2018 | http://zftlab.org/pages/2018010700.html 4 | # Telegram Bot - Snapshot 5 | 6 | 7 | IPC=/mnt/mtd/ipcam.conf 8 | TMP=/var/tmp 9 | 10 | 11 | if [ -f ${IPC} ]; then 12 | while read settings 13 | do local ${settings} 14 | done < ${IPC} 15 | # 16 | if [ ${socks5_enable} = 1 ]; then 17 | curl_options="-s -k --socks5-hostname ${socks5_server}:${socks5_port} --proxy-user ${socks5_login}:${socks5_password}" 18 | else 19 | curl_options="-s -k" 20 | fi 21 | # 22 | stamp=$(date +%Y.%m.%d_%H:%M:%S) 23 | # 24 | # curl -s -k "http://127.0.0.1/webcapture.jpg?command=snap&channel=1" -o ${TMP}/snap.jpg 25 | getxmsnap ${TMP}/snap.jpg && \ 26 | curl ${curl_options} -X POST "https://api.telegram.org/bot${telegram_token}/sendPhoto?chat_id=${telegram_group}" -H "Content-Type: multipart/form-data" \ 27 | -F "photo=@${TMP}/snap.jpg" -F "caption=${device_name} - ${stamp}" >/dev/null 2>&1 && \ 28 | rm -rf ${TMP}/snap.jpg 29 | # 30 | fi -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 OpenIPC 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /plugins/ipcam_mqtt_listner: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Simple Comand Plugin for MQTT OpenIPC mod 3 | # Author Philipp@inbox.ru 2021 4 | # Licence MIT 5 | # based on https://github.com/pkoevesdi/MQTT-Logger 6 | 7 | 8 | IPC=/mnt/mtd/ipcam.conf 9 | mpipe=/tmp/mqtt_pipe 10 | pidfile=/tmp/mqtt_sub_pidfile 11 | 12 | #check is mosquitto_sub runs, some clean ups 13 | kill -9 $(cat $pidfile) 2>/dev/null 14 | rm -f $mpipe $pidfile 15 | 16 | if [ -f ${IPC} ]; then 17 | while read settings 18 | do local ${settings} 19 | done < ${IPC} 20 | # 21 | # Is Enabled MQTT 22 | if [ ${mqtt_enable} = 1 ]; then 23 | # create fifo file 24 | ([ ! -p "$mpipe" ]) && mkfifo $mpipe 25 | # subscribe mosquitto toppic 26 | (mosquitto_sub -h ${mqtt_server} -p ${mqtt_port} -u ${mqtt_login} -P ${mqtt_password} -t "${mqtt_login}/${device_name}/cmds" 1>$mpipe 2>/dev/null) & 27 | # store mosquitto_sub pid in file 28 | echo "$!" > $pidfile 29 | # read subscribed data 30 | echo read subscribed data 31 | while read message <$mpipe 32 | do 33 | # echo readed command for debug purpose 34 | echo "$message" 35 | # process commands 36 | case "$message" in 37 | ("snap") 38 | /bin/ipcam_mqtt 39 | ;; 40 | ("reboot") 41 | /sbin/reboot 42 | ;; 43 | esac 44 | done 45 | fi 46 | fi -------------------------------------------------------------------------------- /plugins/ipcam_tunnel: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # ZFT Lab. 2018 | http://zftlab.org/pages/2018010700.html 4 | # Simple Plugin - Tunnel 5 | 6 | 7 | MAC=$(ifconfig eth0 | awk '/HWaddr/ {print $5}') 8 | PAS=$(echo ${MAC} | sha1sum | awk '{print $1}') 9 | TID=$(echo ${MAC} | tr -d ':') 10 | IPC=/mnt/mtd/ipcam.conf 11 | CFG=/var/tmp/vtund.conf 12 | TMP=/var/tmp 13 | 14 | 15 | if [ -f ${IPC} ]; then 16 | # 17 | while read settings 18 | do local ${settings} 19 | done < ${IPC} 20 | # 21 | if [ ${vtund_enable} = 1 ]; then 22 | # 23 | [ -f /mnt/web/zftlab/lib/modules/tun.ko ] && insmod /mnt/web/zftlab/lib/modules/tun.ko >/dev/null 2>&1 24 | # 25 | ( echo "#" 26 | echo "# ZFT Lab. 2018 | http://zftlab.org/pages/2018010700.html" 27 | echo "# Simple example VTUNd config (autogenerated)" 28 | echo "#" 29 | echo "options {" 30 | echo " port ${vtund_port};" 31 | echo " ifconfig /sbin/ifconfig;" 32 | echo "}" 33 | echo "${TID} {" 34 | echo " password ${PAS};" 35 | echo " device tunnel;" 36 | echo " stat no;" 37 | echo " persist yes;" 38 | echo " timeout 10;" 39 | echo " up {" 40 | echo " ifconfig \"%d hw ether ${MAC} mtu 1500 -multicast up\";" 41 | echo " program \"udhcpc -q -n -C -p /var/tmp/udhcpc-%%.pid -s /bin/tapip -i %d -t 5 -x hostname:${device_name}\";" 42 | echo " };" 43 | echo " down {" 44 | echo " ifconfig \"%d down\";" 45 | echo " };" 46 | echo "}" 47 | ) >${CFG} 48 | # 49 | (while true ; do sleep 10; tunctl -t tunnel; vtund -n -f ${CFG} ${TID} ${vtund_server} >/dev/null 2>&1; done) & 50 | fi 51 | fi 52 | 53 | exit 0 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## IPCam modding 2 | 3 | **Advanced modifications of IP camera firmware from the [OpenIPC](https://openipc.org) project** 4 | 5 | [](https://github.com/OpenIPC/modding/releases) 6 |  7 |  8 |  9 | [](https://opensource.org/licenses/MIT) 10 | 11 | ----- 12 | 13 | ### Downloads 14 | 15 | https://github.com/OpenIPC/modding/releases 16 | 17 | P.S. Old vesrions can be found [here](https://t.me/s/openipc_updates/1) 18 | 19 | ----- 20 | 21 | ### Supporting 22 | 23 | If you like our work, please consider supporting us on [Open Collective](https://opencollective.com/openipc/contribute/backer-14335/checkout). 24 | 25 | [](https://opencollective.com/openipc) 26 | [](https://opencollective.com/openipc) 27 | 28 | [](https://opencollective.com/openipc#support) 29 | 30 | ### Thanks a lot !!! 31 | 32 |
35 | 36 | ----- 37 | 38 | ### Updates 39 | 40 | #### 2020.05.08 41 | 42 | * Fix scp path (TNX XPhilipp) 43 | * Remove old unused mqtt telemetry code (TNX XPhilipp) 44 | * Add ipcam_mqtt_listner plugin (TNX XPhilipp) 45 | * Update IPC_XiongMai_00002532_HI3516CV100 platform 46 | * Update IPC_XiongMai_00023650_XM510 platform 47 | * Update IPC_XiongMai_00023651_XM510 platform 48 | -------------------------------------------------------------------------------- /plugins/ipcam_wifi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # ZFT Lab. 2018 | http://zftlab.org/pages/2018010700.html 4 | # Simple Plugin - WiFi 5 | 6 | 7 | IPC=/mnt/mtd/ipcam.conf 8 | CFG=/var/tmp/wpa_supplicant.conf 9 | TMP=/var/tmp 10 | 11 | 12 | if [ -f ${IPC} ]; then 13 | # 14 | while read settings 15 | do local ${settings} 16 | done < ${IPC} 17 | # 18 | if [ ${wifi_enable} = 1 ]; then 19 | # 20 | local wifi_iface=auto # Wait ra0/eth2 21 | # 22 | # USB WiFi MT7601 23 | if grep "ProdID=7601" /proc/bus/usb/devices > /dev/null; then 24 | if [ -e /mnt/web/zftlab/lib/modules/mt7601Usta.ko ]; then 25 | himm 0x20050084 0x001d2188 26 | himm 0x20050078 0x1414c001 27 | insmod /mnt/web/zftlab/lib/modules/mt7601Usta.ko 28 | local wifi_type=mt7601 29 | local wifi_iface=ra0 30 | fi 31 | fi 32 | # 33 | # USB WiFi RT3070 34 | if grep "ProdID=3070" /proc/bus/usb/devices > /dev/null; then 35 | if [ -e /mnt/web/zftlab/lib/modules/rt3070sta.ko ]; then 36 | himm 0x20050084 0x001d2188 37 | himm 0x20050078 0x1414c001 38 | insmod /mnt/web/zftlab/lib/modules/rt3070sta.ko 39 | local wifi_type=rt3070 40 | local wifi_iface=eth2 41 | fi 42 | fi 43 | # 44 | # USB WiFi RTL8188 45 | if grep "ProdID=8179" /proc/bus/usb/devices > /dev/null; then 46 | if [ -e /mnt/web/zftlab/lib/modules/8188eu.ko ]; then 47 | himm 0x20050084 0x001d2188 48 | himm 0x20050078 0x1414c001 49 | insmod /mnt/web/zftlab/lib/modules/8188eu.ko 50 | local wifi_type=rtl8188 51 | local wifi_iface=eth2 52 | fi 53 | fi 54 | # 55 | # USB WiFi RTL8187 56 | #if grep "ProdID=8187" /proc/bus/usb/devices > /dev/null; then 57 | # if [ -e /mnt/web/zftlab/lib/modules/8188eu.ko ]; then 58 | # himm 0x20050084 0x001d2188 59 | # himm 0x20050078 0x1414c001 60 | # insmod /mnt/web/zftlab/lib/modules/8188eu.ko 61 | # local wifi_type=rtl8187 62 | # local wifi_iface=eth2 63 | # fi 64 | #fi 65 | # 66 | if [ ${wifi_iface} != "auto" ]; then 67 | # 68 | local wifi_psk=$(wpa_passphrase ${wifi_ssid} ${wifi_password} | awk -F '=' '/psk/ {print $2}' | tail -n 1) 69 | # 70 | ip link set ${wifi_iface} down 71 | ip link set ${wifi_iface} name wlan0 72 | local wifi_iface=wlan0 73 | ip link set ${wifi_iface} up 74 | # 75 | ( echo "#" 76 | echo "# ZFT Lab. 2018 | http://zftlab.org/pages/2018010700.html" 77 | echo "# Simple example VTUNd config (autogenerated)" 78 | echo "#" 79 | echo "ctrl_interface_group=0" 80 | echo "ap_scan=1" 81 | echo "#" 82 | echo "network={" 83 | echo " ssid=\"${wifi_ssid}\"" 84 | echo " #psk=\"${wifi_password}\"" 85 | echo " psk=${wifi_psk}" 86 | echo " proto=WPA2" 87 | echo " key_mgmt=WPA-PSK" 88 | echo " pairwise=CCMP TKIP" 89 | echo " group=CCMP TKIP" 90 | echo "}" 91 | ) >${CFG} 92 | # 93 | ifconfig ${wifi_iface} up 94 | # 95 | if [ -f /bin/wpa_supplicant ]; then 96 | (while true ; do sleep 1; wpa_supplicant -P ${TMP}/wpa_supplicant-${wifi_iface}.pid -D wext -i ${wifi_iface} -c ${CFG} -C ${TMP}/wpa_supplicant >/dev/null 2>&1; done) & 97 | sleep 5; iwpriv ${wifi_iface} set WPAPSK=${wifi_psk} 98 | fi 99 | # 100 | # (while true ; do sleep 5; udhcpc -f -C -p ${TMP}/udhcpc-${wifi_iface}.pid -s /bin/tapip -t 0 -i ${wifi_iface} -C >/dev/null 2>&1; done) & 101 | (while true ; do sleep 5; udhcpc -f -C -p ${TMP}/udhcpc-${wifi_iface}.pid -s /usr/sbin/udhcpc.script.wifi -t 0 -i ${wifi_iface} -x hostname:${device_name} >/dev/null 2>&1; done) & 102 | # 103 | fi 104 | # 105 | fi 106 | # 107 | fi 108 | 109 | exit 0 110 | -------------------------------------------------------------------------------- /plugins/ipcam_system: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # ZFT Lab. 2018 | http://zftlab.org/pages/2018010700.html 4 | # Simple Plugin - System 5 | 6 | 7 | IPC=/mnt/mtd/ipcam.conf 8 | TMP=/var/tmp 9 | 10 | 11 | if [ -f ${IPC} ]; then 12 | while read settings 13 | do local ${settings} 14 | done < ${IPC} 15 | # 16 | # Enable Cron daemon 17 | if [ ${crond_enable} = 1 ]; then 18 | if [ -f /sbin/crond ]; then 19 | # 20 | [ -d /mnt/mtd/crontabs ] || mkdir -p /mnt/mtd/crontabs 21 | [ -f /mnt/mtd/crontabs/root ] || ( echo -e "#\n*/1 * * * * logger -s test 'Check running crond'\n#" >>/mnt/mtd/crontabs/root ;\n 22 | echo -e "#\n*/3 * * * * /bin/rdate -s time.nist.gov\n#" >>/mnt/mtd/crontabs/root ;\n 23 | echo -e "#\n*/1 * * * * /bin/ipcam_mqtt\n#" >>/mnt/mtd/crontabs/root ;\n 24 | echo -e "#\n*/1 * * * * /bin/ipcam_telegram\n#" >>/mnt/mtd/crontabs/root ;\n 25 | echo -e "#\n*/1 * * * * /bin/ipcam_webdav\n#" >>/mnt/mtd/crontabs/root ;\n 26 | echo -e "#\n*/1 * * * * /bin/ipcam_yandex\n#" >>/mnt/mtd/crontabs/root ;\n 27 | ) 28 | /sbin/crond -b -c /mnt/mtd/crontabs 29 | fi 30 | fi 31 | # 32 | # Enable FTP server 33 | if [ ${ftpd_enable} = 1 ]; then 34 | if [ -f /sbin/tcpsvd ]; then 35 | if [ -f /sbin/ftpd ]; then 36 | (while true ; do sleep 5; /sbin/tcpsvd -vE -l ${device_name} -u root 0.0.0.0 21 /sbin/ftpd -w / >/dev/null 2>&1; done) & 37 | fi 38 | fi 39 | fi 40 | # 41 | # Enable SSH server 42 | if [ ${sshd_enable} = 1 ]; then 43 | if [ -f /sbin/dropbear ]; then 44 | # 45 | [ -d /mnt/mtd/dropbear ] || (mkdir -p /mnt/mtd/dropbear; chown root /etc/dropbear ; chmod 0700 /etc/dropbear) 46 | [ -s /mnt/mtd/dropbear/dropbear_dss_host_key ] || dropbearkey -t rsa -f /mnt/mtd/dropbear/dropbear_dss_host_key 47 | [ -s /mnt/mtd/dropbear/dropbear_rsa_host_key ] || dropbearkey -t rsa -f /mnt/mtd/dropbear/dropbear_rsa_host_key 48 | /sbin/dropbear -P ${TMP}/dropbear.pid -p ${sshd_port} -K 300 49 | fi 50 | fi 51 | # 52 | # Enable console login system 53 | if [ ${getty_enable} = 1 ]; then 54 | if [ -f /sbin/getty ]; then 55 | (while true ; do sleep 5; /sbin/getty -L /dev/ttyAMA0 115200 vt100 -n root >/dev/null 2>&1; done) & 56 | fi 57 | fi 58 | # 59 | # Enable USB storage 60 | if [ ${storage_enable} = 1 ]; then 61 | if [ -e /mnt/web/zftlab/lib/modules/usb-storage.ko ]; then 62 | himm 0x20050084 0x001d2188 63 | himm 0x20050078 0x1414c001 64 | insmod /mnt/web/zftlab/lib/modules/usb-storage.ko 65 | fi 66 | fi 67 | # 68 | # Enable Telnet server 69 | if [ ${telnetd_enable} = 1 ]; then 70 | if [ -f /sbin/telnetd ]; then 71 | /sbin/telnetd -p ${telnetd_port} 72 | fi 73 | fi 74 | # 75 | # Enable HTTP server (Octonix version) 76 | if [ ${webface_enable} = 1 ]; then 77 | if [ -f /sbin/httpd ]; then 78 | echo -e "#\nA:*\n/cgi-bin:manager:${webface_password}\n#\n" >${TMP}/httpd.conf 79 | /sbin/httpd -p ${webface_port} -h /mnt/web/zftlab/www -c ${TMP}/httpd.conf 80 | fi 81 | fi 82 | # 83 | # Telegram 84 | if [ ${telegram_enable} = 1 ]; then 85 | if [ -f /bin/ipcam_tgbot ]; then 86 | if [ -f /mnt/mtd/telegram_offset ]; then 87 | cp /mnt/mtd/telegram_offset /var/tmp/telegram_offset 88 | fi 89 | (while true ; do sleep 5; /bin/ipcam_tgbot >/dev/null 2>&1; done) & 90 | fi 91 | fi 92 | # 93 | # OSD test 94 | if [ -f /etc/fVideo ]; then 95 | MD5SUM1=$(md5sum /mnt/mtd/Config/Json/fVideo | awk '{print $1}') 96 | MD5SUM2=$(md5sum /etc/fVideo | awk '{print $1}') 97 | if [ ${MD5SUM1} = ${MD5SUM2} ]; then 98 | logger -s test 'No OSD update' 99 | else 100 | cp /etc/fVideo /mnt/mtd/Config/Json/fVideo >/dev/null 2>&1 101 | logger -s test 'Update file with OSD setting' 102 | fi 103 | fi 104 | # 105 | fi 106 | 107 | exit 0 108 | -------------------------------------------------------------------------------- /plugins/ipcam_combine: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # ZFT Lab. 1994-2018 - IPCam Combine | http://zftlab.org/pages/2018010700.html 4 | 5 | MAC=$(ifconfig eth0 | awk '/HWaddr/ {print $5}') 6 | PAS=$(echo ${MAC} | sha1sum | awk '{print $1}') 7 | TID=$(echo ${MAC} | tr -d ':') 8 | 9 | 10 | 11 | help() { 12 | echo -e "\nPLEASE SELECT HARDWARE AND SERVICE IN COMMAND LINE" 13 | echo -e "\nPossible hardware:\n jvt\n topsee\n xm\n" 14 | echo -e "\nPossible service:\n ipeye\n" 15 | } 16 | 17 | 18 | hardware() { 19 | case $hardware in 20 | 21 | jvt) 22 | RWC="/etc/" 23 | IPC=${RWC}ipcam.conf 24 | TMP=/var/run 25 | RTSP1="rtsp://127.0.0.1:554/av0_0" 26 | RTSP2="rtsp://127.0.0.1:554/av0_1" 27 | (sleep 1; logger -t ipcam_combine "Device hardware type is JVT...") & 28 | ;; 29 | 30 | topsee) 31 | #RWC="/etc/" 32 | #IPC=${RWC}ipcam.conf 33 | #TMP=/var/run 34 | RTSP1="" 35 | RTSP2="" 36 | (sleep 1; logger -t ipcam_combine "Device hardware type is TOPSEE...") & 37 | ;; 38 | 39 | xm) 40 | RWC="/mnt/mtd/" 41 | IPC=${RWC}ipcam.conf 42 | TMP=/var/tmp 43 | PASSW=$(cat /mnt/mtd/Config/Account1 | jsonfilter -e '@.Users[@.Name="admin"].Password') 44 | RTSP1="rtsp://127.0.0.1/user=admin&password=${PASSW}&channel=1&stream=0.sdp?real_stream" 45 | RTSP2="rtsp://127.0.0.1/user=admin&password=${PASSW}&channel=1&stream=1.sdp?real_stream" 46 | (sleep 1; logger -t ipcam_combine "Device hardware type is XM...") & 47 | ;; 48 | 49 | *) 50 | help 51 | ;; 52 | 53 | esac 54 | } 55 | 56 | 57 | settings() { 58 | if [ -f ${IPC} ]; then 59 | while read settings 60 | do export ${settings} # Also can use export/local 61 | done < ${IPC} 62 | (sleep 1; logger -t ipcam_combine "Load settings from ${IPC} file...") & 63 | else 64 | ( echo "alarm_enable=0" 65 | echo "alarm_port=15002" 66 | echo "alarm_listen=0.0.0.0" 67 | echo "alarm_command=/bin/ipcam_telegram" 68 | echo "crond_enable=0" 69 | echo "curl_timeout=30" 70 | echo "device_name=IPCam" 71 | echo "device_tid=${TID}" 72 | echo "ftpd_enable=0" 73 | echo "getty_enable=0" 74 | echo "ipeye_enable=0" 75 | echo "mqtt_enable=0" 76 | echo "mqtt_server=mqtt.flymon.net" 77 | echo "mqtt_port=1883" 78 | echo "mqtt_login=ipcam@flymon.net" 79 | echo "mqtt_password=test2018" 80 | echo "osd_text=zftlab.org" 81 | echo "osd_color=FFFFFF" 82 | echo "snmpd_enable=0" 83 | echo "snmpd_community=public" 84 | echo "socks5_enable=0" 85 | echo "socks5_server=my.proxy.org" 86 | echo "socks5_port=8081" 87 | echo "socks5_login=mylogin" 88 | echo "socks5_password=mypass" 89 | echo "sshd_enable=0" 90 | echo "sshd_port=22" 91 | echo "storage_enable=0" 92 | echo "syslogd_enable=0" 93 | echo "telegram_enable=0" 94 | echo "telegram_group=-283722443" 95 | echo "telegram_token=123:XYZ" 96 | echo "telnetd_enable=1" 97 | echo "telnetd_port=23" 98 | echo "time_zone=UTC-3" 99 | echo "vtund_enable=0" 100 | echo "vtund_server=my.server.org" 101 | echo "vtund_port=5000" 102 | echo "vtund_password=${PAS}" 103 | echo "webdav_enable=0" 104 | echo "webdav_login=mylogin" 105 | echo "webdav_password=mypass" 106 | echo "webdav_server=my.server.org" 107 | echo "webface_enable=0" 108 | echo "webface_port=81" 109 | echo "webface_password=1234" 110 | echo "wifi_enable=0" 111 | echo "wifi_ssid=MyWiFi" 112 | echo "wifi_password=test2018" 113 | echo "wifi_type=auto" 114 | echo "wifi_iface=auto" 115 | echo "wifi_psk=auto" 116 | echo "wifi_proto=auto" 117 | echo "wifi_auth=auto" 118 | echo "wifi_network=dhcp" 119 | echo "yandex_enable=0" 120 | echo "yandex_folder=Public" 121 | echo "yandex_login=mylogin" 122 | echo "yandex_password=mypass" 123 | echo "zftlab_version=20210215" 124 | ) >${IPC} 125 | (sleep 1; logger -t ipcam_combine "Write default settings to ${IPC} file...") & 126 | # 127 | while read settings 128 | do export ${settings} 129 | done < ${IPC} 130 | (sleep 1; logger -t ipcam_combine "Load settings from ${IPC} file...") & 131 | # 132 | hostname IPCam 133 | fi 134 | } 135 | 136 | 137 | service_alarm() { 138 | if [ ${alarm_enable} = 1 ]; then 139 | if [ -f /sbin/tcpsvd ]; then 140 | (while true ; do sleep 10; tcpsvd -vE -l ${device_name} -u root ${alarm_listen} ${alarm_port} ${alarm_command} >/dev/null 2>&1; done) & 141 | fi 142 | logger -t ipcam_combine "Start alarm service..." 143 | fi 144 | } 145 | 146 | service_ipeye() { 147 | if [ ${ipeye_enable} = 1 ]; then 148 | if [ -f /bin/ipeye ]; then 149 | (while true ; do sleep 10; ipeye -config_dir="${RWC}" -streams="${RTSP1},${RTSP2}" -enable_debug=1 >/dev/null 2>&1; done) & 150 | fi 151 | # Integrated inside options: -http_camera_mode | -vendor | -http_logo_text | -http_logo_site | -http_logo_url 152 | logger -t ipcam_combine "Start ipeye service..." 153 | fi 154 | } 155 | 156 | service_snmpd() { 157 | if [ ${snmpd_enable} = 1 ]; then 158 | if [ -f /bin/snmpd ]; then 159 | ( echo "#" 160 | echo "agentAddress udp:161" 161 | echo "sysLocation Ospedaletti, Imperia, IT" 162 | echo "sysContact ZFT Lab.