From d812e53203ee1c4a7efdf827fa9ec6d6b6297921 Mon Sep 17 00:00:00 2001 From: gaggi Date: Fri, 8 Feb 2019 20:31:37 +0100 Subject: [PATCH 1/9] [Add] Adding wsdd to gitmodules --- .gitmodules | 3 +++ 1 file changed, 3 insertions(+) mode change 100644 => 100755 .gitmodules diff --git a/.gitmodules b/.gitmodules old mode 100644 new mode 100755 index bb90ca9..69b586f --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "src/ftpd/pure-ftpd"] path = src/ftpd/pure-ftpd url = https://github.com/jedisct1/pure-ftpd.git +[submodule "src/wsdd/wsdd"] + path = src/wsdd/wsdd + url = https://github.com/KoynovStas/wsdd.git From e648cbc1aebce7291bd61c82503a1d6df38ebf44 Mon Sep 17 00:00:00 2001 From: gaggi Date: Sat, 9 Feb 2019 10:31:01 +0100 Subject: [PATCH 2/9] [Add] Added wsdd to gitmodules --- src/busybox/.config | 2 +- src/busybox/httpd.patch | 14 +++++++++++ src/wsdd/wsdd | 1 + src/wsdd/wsdd.patch | 55 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 src/busybox/httpd.patch create mode 160000 src/wsdd/wsdd create mode 100644 src/wsdd/wsdd.patch diff --git a/src/busybox/.config b/src/busybox/.config index f1d07fb..3a2dc07 100644 --- a/src/busybox/.config +++ b/src/busybox/.config @@ -849,7 +849,7 @@ CONFIG_FEATURE_HTTPD_CGI=y # CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set # CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set # CONFIG_FEATURE_HTTPD_PROXY is not set -# CONFIG_FEATURE_HTTPD_GZIP is not set +CONFIG_FEATURE_HTTPD_GZIP is not set CONFIG_IFCONFIG=y CONFIG_FEATURE_IFCONFIG_STATUS=y CONFIG_FEATURE_IFCONFIG_SLIP=y diff --git a/src/busybox/httpd.patch b/src/busybox/httpd.patch new file mode 100644 index 0000000..023d5b0 --- /dev/null +++ b/src/busybox/httpd.patch @@ -0,0 +1,14 @@ +--- yi-hack-v4/src/busybox/busybox/networking/httpd.c 2019-02-08 20:24:33.917338666 +0100 ++++ test/yi-hack-v4/src/busybox/busybox/networking/httpd.c 2019-02-06 16:33:46.582275044 +0100 +@@ -2430,9 +2430,9 @@ + tptr = urlcopy + 1; /* skip first '/' */ + + #if ENABLE_FEATURE_HTTPD_CGI +- if (is_prefixed_with(tptr, "cgi-bin/")) { ++ if (is_prefixed_with(tptr, "onvif/") || is_prefixed_with(tptr, "cgi-bin/")) { + if (tptr[8] == '\0') { +- /* protect listing "cgi-bin/" */ ++ /* protect listing "onvif/" and "cgi-bin/" */ + send_headers_and_exit(HTTP_FORBIDDEN); + } + send_cgi_and_exit(urlcopy, urlcopy, prequest, length, cookie, content_type); diff --git a/src/wsdd/wsdd b/src/wsdd/wsdd new file mode 160000 index 0000000..ca60dcc --- /dev/null +++ b/src/wsdd/wsdd @@ -0,0 +1 @@ +Subproject commit ca60dcc5ee52fe466fd684fdbb880832ee031fae diff --git a/src/wsdd/wsdd.patch b/src/wsdd/wsdd.patch new file mode 100644 index 0000000..d960f44 --- /dev/null +++ b/src/wsdd/wsdd.patch @@ -0,0 +1,55 @@ +Only in wsdd_god: .depend +Binary files wsdd/.git/index and wsdd_god/.git/index differ +diff -upr wsdd/Makefile wsdd_god/Makefile +--- wsdd/Makefile 2019-01-25 14:43:10.725532289 +0100 ++++ wsdd_god/Makefile 2019-01-25 12:25:06.678016550 +0100 +@@ -35,9 +35,9 @@ CFLAGS += -DDAEMON_NO_CLOSE_ST + CFLAGS += -I$(COMMON_DIR) + CFLAGS += -I$(GENERATED_DIR) + CFLAGS += -I$(GSOAP_DIR) -I$(GSOAP_PLUGIN_DIR) -I$(GSOAP_IMPORT_DIR) +-CFLAGS += -O2 -Wall -pipe ++CFLAGS += -lm -Os -Wall -pipe + +-GCC ?= gcc ++GCC ?= arm-hisiv300-linux-gcc + + + +@@ -216,7 +216,7 @@ define build_gsoap + # get archive + if [ ! -f SDK/gsoap.zip ]; then \ + mkdir -p SDK; \ +- wget -O ./SDK/gsoap.zip.tmp "https://sourceforge.net/projects/gsoap2/files/gsoap-2.8/gsoap_2.8.66.zip/download" && \ ++ wget -O ./SDK/gsoap.zip.tmp "https://sourceforge.net/projects/gsoap2/files/oldreleases/gsoap_2.8.66.zip/download" && \ + mv ./SDK/gsoap.zip.tmp ./SDK/gsoap.zip; \ + fi + +diff -upr wsdd/src/wsdd.c wsdd_god/src/wsdd.c +--- wsdd/src/wsdd.c 2019-01-25 14:43:10.725532289 +0100 ++++ wsdd_god/src/wsdd.c 2019-01-25 12:21:18.860889936 +0100 +@@ -332,16 +332,18 @@ void init_gsoap() + // Note that this IP_ADD_MEMBERSHIP option must be + // called for each local interface over which the multicast + // datagrams are to be received. +- struct ip_mreqn mcast; ++ struct ip_mreq mcast; + mcast.imr_multiaddr.s_addr = inet_addr(WSDD_MULTICAST_IP); +- if( get_addr_of_if(wsdd_param.if_name, AF_INET, &mcast.imr_address) != 0 ) +- { +- daemon_error_exit("Cant get addr for interface error: %m\n"); +- } ++ //if( get_addr_of_if(wsdd_param.if_name, AF_INET, &mcast.imr_address) != 0 ) ++ //{ ++ //daemon_error_exit("Cant get addr for interface error: %m\n"); ++ //} + +- setsockopt(soap_srv->master, IPPROTO_IP, IP_MULTICAST_IF, &mcast.imr_address.s_addr, sizeof(struct in_addr)); ++ //setsockopt(soap_srv->master, IPPROTO_IP, IP_MULTICAST_IF, &mcast.imr_address.s_addr, sizeof(struct in_addr)); + +- if(setsockopt(soap_srv->master, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&mcast, sizeof(mcast)) != 0 ) ++ ++ mcast.imr_interface.s_addr = htonl(INADDR_ANY); ++ if(setsockopt(soap_srv->master, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mcast, sizeof(mcast)) != 0 ) + { + daemon_error_exit("Cant adding multicast group error: %m\n"); + } From 48a2f616df8eb1cd23d756008624bd503a2db6b0 Mon Sep 17 00:00:00 2001 From: gaggi Date: Sat, 9 Feb 2019 11:17:55 +0100 Subject: [PATCH 3/9] [Edit] Small changes in the build scripts --- src/busybox/.config | 2 +- src/busybox/httpd.patch | 4 ++-- src/busybox/init.busybox | 5 ++++- src/wsdd/compile.wsdd | 12 ++++++++++++ src/wsdd/init.wsdd | 12 ++++++++++++ src/wsdd/install.wsdd | 12 ++++++++++++ 6 files changed, 43 insertions(+), 4 deletions(-) create mode 100755 src/wsdd/compile.wsdd create mode 100755 src/wsdd/init.wsdd create mode 100755 src/wsdd/install.wsdd diff --git a/src/busybox/.config b/src/busybox/.config index 3a2dc07..0ff2083 100644 --- a/src/busybox/.config +++ b/src/busybox/.config @@ -849,7 +849,7 @@ CONFIG_FEATURE_HTTPD_CGI=y # CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set # CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set # CONFIG_FEATURE_HTTPD_PROXY is not set -CONFIG_FEATURE_HTTPD_GZIP is not set +CONFIG_FEATURE_HTTPD_GZIP=y CONFIG_IFCONFIG=y CONFIG_FEATURE_IFCONFIG_STATUS=y CONFIG_FEATURE_IFCONFIG_SLIP=y diff --git a/src/busybox/httpd.patch b/src/busybox/httpd.patch index 023d5b0..7371ff5 100644 --- a/src/busybox/httpd.patch +++ b/src/busybox/httpd.patch @@ -1,5 +1,5 @@ ---- yi-hack-v4/src/busybox/busybox/networking/httpd.c 2019-02-08 20:24:33.917338666 +0100 -+++ test/yi-hack-v4/src/busybox/busybox/networking/httpd.c 2019-02-06 16:33:46.582275044 +0100 +--- busybox/networking/httpd.c 2019-02-08 20:24:33.917338666 +0100 ++++ new/yi-hack-v4/src/busybox/busybox/networking/httpd.c 2019-02-06 16:33:46.582275044 +0100 @@ -2430,9 +2430,9 @@ tptr = urlcopy + 1; /* skip first '/' */ diff --git a/src/busybox/init.busybox b/src/busybox/init.busybox index 5d8fe89..276c328 100755 --- a/src/busybox/init.busybox +++ b/src/busybox/init.busybox @@ -1,4 +1,4 @@ -#!/bin/bash +#/bin/bash SCRIPT_DIR=$(cd `dirname $0` && pwd) cd $SCRIPT_DIR @@ -10,3 +10,6 @@ git reset --hard || exit 1 cp ../.config ./ || exit 1 +cd $SCRIPT_DIR +patch -p0 < httpd.patch + diff --git a/src/wsdd/compile.wsdd b/src/wsdd/compile.wsdd new file mode 100755 index 0000000..50c3aa0 --- /dev/null +++ b/src/wsdd/compile.wsdd @@ -0,0 +1,12 @@ +#!/bin/bash + +SCRIPT_DIR=$(cd `dirname $0` && pwd) +cd $SCRIPT_DIR + +cd wsdd + +make clean || exit 1 +make release || exit 1 + +mkdir -p ../_install +cp ./wsdd ../_install diff --git a/src/wsdd/init.wsdd b/src/wsdd/init.wsdd new file mode 100755 index 0000000..03b9e4a --- /dev/null +++ b/src/wsdd/init.wsdd @@ -0,0 +1,12 @@ +#!/bin/bash + +SCRIPT_DIR=$(cd `dirname $0` && pwd) +cd $SCRIPT_DIR + +rm -rf ./_install + +cd wsdd +git reset --hard || exit 1 + +cd $SCRIPT_DIR +patch -p0 < wsdd.patch diff --git a/src/wsdd/install.wsdd b/src/wsdd/install.wsdd new file mode 100755 index 0000000..372d9cf --- /dev/null +++ b/src/wsdd/install.wsdd @@ -0,0 +1,12 @@ +#!/bin/bash + +SCRIPT_DIR=$(cd `dirname $0` && pwd) +cd $SCRIPT_DIR + +# Compress the file +upx ./_install/wsdd + +mkdir -p ../../build/home/yi-hack-v4/sbin/ + +rsync -a ./_install/wsdd ../../build/home/yi-hack-v4/sbin/ + From 5bc1dd5e3db891150a0bb9e424cbf8deceafde38 Mon Sep 17 00:00:00 2001 From: gaggi Date: Mon, 25 Feb 2019 08:37:58 +0100 Subject: [PATCH 4/9] Removed submodule wsdd --- .gitmodules | 5 +---- src/wsdd/wsdd | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 160000 src/wsdd/wsdd diff --git a/.gitmodules b/.gitmodules index 69b586f..b843db0 100755 --- a/.gitmodules +++ b/.gitmodules @@ -12,7 +12,4 @@ url = https://github.com/rofl0r/proxychains-ng.git [submodule "src/ftpd/pure-ftpd"] path = src/ftpd/pure-ftpd - url = https://github.com/jedisct1/pure-ftpd.git -[submodule "src/wsdd/wsdd"] - path = src/wsdd/wsdd - url = https://github.com/KoynovStas/wsdd.git + url = https://github.com/jedisct1/pure-ftpd.git \ No newline at end of file diff --git a/src/wsdd/wsdd b/src/wsdd/wsdd deleted file mode 160000 index ca60dcc..0000000 --- a/src/wsdd/wsdd +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ca60dcc5ee52fe466fd684fdbb880832ee031fae From 86b8dd7088335f0177d0e20f8bdc081567e534ed Mon Sep 17 00:00:00 2001 From: gaggi Date: Mon, 25 Feb 2019 09:24:28 +0100 Subject: [PATCH 5/9] Remove last wsdd files --- .../static/home/yi-hack-v4/etc/system.conf | 1 + .../static/home/yi-hack-v4/script/system.sh | 4 ++ src/wsdd/compile.wsdd | 12 ---- src/wsdd/init.wsdd | 12 ---- src/wsdd/install.wsdd | 12 ---- src/wsdd/wsdd.patch | 55 ------------------- 6 files changed, 5 insertions(+), 91 deletions(-) delete mode 100755 src/wsdd/compile.wsdd delete mode 100755 src/wsdd/init.wsdd delete mode 100755 src/wsdd/install.wsdd delete mode 100644 src/wsdd/wsdd.patch diff --git a/src/static/static/home/yi-hack-v4/etc/system.conf b/src/static/static/home/yi-hack-v4/etc/system.conf index 3e27575..fd816c4 100755 --- a/src/static/static/home/yi-hack-v4/etc/system.conf +++ b/src/static/static/home/yi-hack-v4/etc/system.conf @@ -4,3 +4,4 @@ DROPBEAR=yes FTPD=yes PROXYCHAINSNG=no CHECK_UPDATES=yes +WSDD=yes diff --git a/src/static/static/home/yi-hack-v4/script/system.sh b/src/static/static/home/yi-hack-v4/script/system.sh index f438aed..036a01f 100755 --- a/src/static/static/home/yi-hack-v4/script/system.sh +++ b/src/static/static/home/yi-hack-v4/script/system.sh @@ -40,6 +40,10 @@ if [[ $(get_config DROPBEAR) == "yes" ]] ; then dropbear -R fi +if [[ $(get_config WSDD) == "yes" ]] ; then + dropbear -R +fi + # First run on startup, then every hour via crond $YI_HACK_PREFIX/script/check_update.sh diff --git a/src/wsdd/compile.wsdd b/src/wsdd/compile.wsdd deleted file mode 100755 index 50c3aa0..0000000 --- a/src/wsdd/compile.wsdd +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -SCRIPT_DIR=$(cd `dirname $0` && pwd) -cd $SCRIPT_DIR - -cd wsdd - -make clean || exit 1 -make release || exit 1 - -mkdir -p ../_install -cp ./wsdd ../_install diff --git a/src/wsdd/init.wsdd b/src/wsdd/init.wsdd deleted file mode 100755 index 03b9e4a..0000000 --- a/src/wsdd/init.wsdd +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -SCRIPT_DIR=$(cd `dirname $0` && pwd) -cd $SCRIPT_DIR - -rm -rf ./_install - -cd wsdd -git reset --hard || exit 1 - -cd $SCRIPT_DIR -patch -p0 < wsdd.patch diff --git a/src/wsdd/install.wsdd b/src/wsdd/install.wsdd deleted file mode 100755 index 372d9cf..0000000 --- a/src/wsdd/install.wsdd +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -SCRIPT_DIR=$(cd `dirname $0` && pwd) -cd $SCRIPT_DIR - -# Compress the file -upx ./_install/wsdd - -mkdir -p ../../build/home/yi-hack-v4/sbin/ - -rsync -a ./_install/wsdd ../../build/home/yi-hack-v4/sbin/ - diff --git a/src/wsdd/wsdd.patch b/src/wsdd/wsdd.patch deleted file mode 100644 index d960f44..0000000 --- a/src/wsdd/wsdd.patch +++ /dev/null @@ -1,55 +0,0 @@ -Only in wsdd_god: .depend -Binary files wsdd/.git/index and wsdd_god/.git/index differ -diff -upr wsdd/Makefile wsdd_god/Makefile ---- wsdd/Makefile 2019-01-25 14:43:10.725532289 +0100 -+++ wsdd_god/Makefile 2019-01-25 12:25:06.678016550 +0100 -@@ -35,9 +35,9 @@ CFLAGS += -DDAEMON_NO_CLOSE_ST - CFLAGS += -I$(COMMON_DIR) - CFLAGS += -I$(GENERATED_DIR) - CFLAGS += -I$(GSOAP_DIR) -I$(GSOAP_PLUGIN_DIR) -I$(GSOAP_IMPORT_DIR) --CFLAGS += -O2 -Wall -pipe -+CFLAGS += -lm -Os -Wall -pipe - --GCC ?= gcc -+GCC ?= arm-hisiv300-linux-gcc - - - -@@ -216,7 +216,7 @@ define build_gsoap - # get archive - if [ ! -f SDK/gsoap.zip ]; then \ - mkdir -p SDK; \ -- wget -O ./SDK/gsoap.zip.tmp "https://sourceforge.net/projects/gsoap2/files/gsoap-2.8/gsoap_2.8.66.zip/download" && \ -+ wget -O ./SDK/gsoap.zip.tmp "https://sourceforge.net/projects/gsoap2/files/oldreleases/gsoap_2.8.66.zip/download" && \ - mv ./SDK/gsoap.zip.tmp ./SDK/gsoap.zip; \ - fi - -diff -upr wsdd/src/wsdd.c wsdd_god/src/wsdd.c ---- wsdd/src/wsdd.c 2019-01-25 14:43:10.725532289 +0100 -+++ wsdd_god/src/wsdd.c 2019-01-25 12:21:18.860889936 +0100 -@@ -332,16 +332,18 @@ void init_gsoap() - // Note that this IP_ADD_MEMBERSHIP option must be - // called for each local interface over which the multicast - // datagrams are to be received. -- struct ip_mreqn mcast; -+ struct ip_mreq mcast; - mcast.imr_multiaddr.s_addr = inet_addr(WSDD_MULTICAST_IP); -- if( get_addr_of_if(wsdd_param.if_name, AF_INET, &mcast.imr_address) != 0 ) -- { -- daemon_error_exit("Cant get addr for interface error: %m\n"); -- } -+ //if( get_addr_of_if(wsdd_param.if_name, AF_INET, &mcast.imr_address) != 0 ) -+ //{ -+ //daemon_error_exit("Cant get addr for interface error: %m\n"); -+ //} - -- setsockopt(soap_srv->master, IPPROTO_IP, IP_MULTICAST_IF, &mcast.imr_address.s_addr, sizeof(struct in_addr)); -+ //setsockopt(soap_srv->master, IPPROTO_IP, IP_MULTICAST_IF, &mcast.imr_address.s_addr, sizeof(struct in_addr)); - -- if(setsockopt(soap_srv->master, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&mcast, sizeof(mcast)) != 0 ) -+ -+ mcast.imr_interface.s_addr = htonl(INADDR_ANY); -+ if(setsockopt(soap_srv->master, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mcast, sizeof(mcast)) != 0 ) - { - daemon_error_exit("Cant adding multicast group error: %m\n"); - } From 7c24bc7e3c1582a7d26b5687f9d3d435561c1cc1 Mon Sep 17 00:00:00 2001 From: gaggi Date: Mon, 25 Feb 2019 09:28:10 +0100 Subject: [PATCH 6/9] Added WebService Discovery server --- src/wsdiscovery/compile.wsdiscovery | 18 ++ src/wsdiscovery/init.wsdiscovery | 6 + src/wsdiscovery/install.wsdiscovery | 7 + src/wsdiscovery/wsdiscovery/Makefile | 11 + .../wsdiscovery/onvif/device_service | 259 ++++++++++++++++++ .../wsdiscovery/onvif/media_service | 257 +++++++++++++++++ src/wsdiscovery/wsdiscovery/wsdiscovery | Bin 0 -> 9808 bytes src/wsdiscovery/wsdiscovery/wsdiscovery.c | 219 +++++++++++++++ 8 files changed, 777 insertions(+) create mode 100755 src/wsdiscovery/compile.wsdiscovery create mode 100755 src/wsdiscovery/init.wsdiscovery create mode 100755 src/wsdiscovery/install.wsdiscovery create mode 100755 src/wsdiscovery/wsdiscovery/Makefile create mode 100755 src/wsdiscovery/wsdiscovery/onvif/device_service create mode 100755 src/wsdiscovery/wsdiscovery/onvif/media_service create mode 100755 src/wsdiscovery/wsdiscovery/wsdiscovery create mode 100755 src/wsdiscovery/wsdiscovery/wsdiscovery.c diff --git a/src/wsdiscovery/compile.wsdiscovery b/src/wsdiscovery/compile.wsdiscovery new file mode 100755 index 0000000..237fa9e --- /dev/null +++ b/src/wsdiscovery/compile.wsdiscovery @@ -0,0 +1,18 @@ +#!/bin/sh + +SCRIPT_DIR=$(cd `dirname $0` && pwd) +cd $SCRIPT_DIR + +echo "Building the WebService Discovery server..." +cd wsdiscovery +make clean +make + +mkdir -p ../_install +cp wsdiscovery ../_install + +mkdir -p ../_install/onvif +echo "Copying the onvif folder..." +cp ./onvif/* ../_install/onvif + +echo "Compilation succeeded." \ No newline at end of file diff --git a/src/wsdiscovery/init.wsdiscovery b/src/wsdiscovery/init.wsdiscovery new file mode 100755 index 0000000..ee9e7aa --- /dev/null +++ b/src/wsdiscovery/init.wsdiscovery @@ -0,0 +1,6 @@ +#!/bin/sh + +SCRIPT_DIR=$(cd `dirname $0` && pwd) +cd $SCRIPT_DIR + +rm -rf ./_install \ No newline at end of file diff --git a/src/wsdiscovery/install.wsdiscovery b/src/wsdiscovery/install.wsdiscovery new file mode 100755 index 0000000..b79128d --- /dev/null +++ b/src/wsdiscovery/install.wsdiscovery @@ -0,0 +1,7 @@ +#!/bin/bash + +SCRIPT_DIR=$(cd `dirname $0` && pwd) +cd $SCRIPT_DIR + +rsync -a ./_install/wsdiscovery ../../build/home/yi-hack-v4/bin/ +rsync -a ./_install/onvif/* ../../build/home/yi-hack-v4/www/onvif/ \ No newline at end of file diff --git a/src/wsdiscovery/wsdiscovery/Makefile b/src/wsdiscovery/wsdiscovery/Makefile new file mode 100755 index 0000000..65e9aaf --- /dev/null +++ b/src/wsdiscovery/wsdiscovery/Makefile @@ -0,0 +1,11 @@ +CC=arm-hisiv300-linux-gcc +STRIP=arm-hisiv300-linux-strip + +all: wsdiscovery + +wsdiscovery: wsdiscovery.c + $(CC) -Os -o wsdiscovery wsdiscovery.c + $(STRIP) wsdiscovery + +clean: + rm -f wsdiscovery \ No newline at end of file diff --git a/src/wsdiscovery/wsdiscovery/onvif/device_service b/src/wsdiscovery/wsdiscovery/onvif/device_service new file mode 100755 index 0000000..b7661cc --- /dev/null +++ b/src/wsdiscovery/wsdiscovery/onvif/device_service @@ -0,0 +1,259 @@ +#!/bin/sh +POST_STRING=$(cat) +printf "Content-type: application/soap+xml\r\n\r\n" + +case $POST_STRING in + *GetSystemDateAndTime*) + printf " + + NTP + true + + %s + + + + %i + %i + %i + + + %i + %i + %i + + + + " "(UTC)" $(date +"%H") $(date +"%M") $(date +"%S") $(date +"%Y") $(date +"%m") $(date +"%d") + ;; + + *GetDeviceInformation*) + printf " + %s + %s + %s + %s + %s + " "YI Technology" $(cat /home/app/.camver) $(cat /home/app/.appver) $(ifconfig | awk '/HWaddr/{print substr($5,1)}') $(grep -e Hardware /proc/cpuinfo | awk '{print $3}') + ;; + + *GetScopes*) + printf " + + Fixed + onvif://www.onvif.org/type/video_encoder + + + Fixed + onvif://www.onvif.org/type/Network_Video_Transmitter + + + Configurable + onvif://www.onvif.org/name/%s + + + Fixed + onvif://www.onvif.org/type/video_analytics + + + Fixed + onvif://www.onvif.org/hardware/%s + + + Configurable + onvif://www.onvif.org/location/ + + + Fixed + onvif://www.onvif.org/type/ptz + + " $(cat /home/app/.camver) $(grep -e Hardware /proc/cpuinfo | awk '{print $3}') + ;; + + *GetNetworkInterfaces*) + printf " + + true + + wlan0 + %s + 1500 + + + true + + + %s + 24 + + true + + + + " $(ifconfig | awk '/HWaddr/{print substr($5,1)}') $(ifconfig | awk '/inet addr/{print substr($2,6)}') + ;; + + *GetDNS*) + printf " + + true + + IPv4 + %s + + + " $(cat /etc/resolv.conf | awk '{print substr($2,1)}') + ;; + + *GetNTP*) + printf " + + true + + " + ;; + + *GetCapabilities*) + IPADDR=$(ifconfig | awk '/inet addr/{print substr($2,6)}') + printf " + + + http://%s/onvif/device_service + + false + false + false + false + + + true + true + true + false + false + false + + 1 + 0 + + + + 0 + 0 + + + false + false + false + false + false + false + false + false + + + + http://%s/onvif/event_service + false + false + false + + + http://%s/onvif/media_service + + false + true + true + + + + http://%s/onvif/ptz_service + + + " $IPADDR $IPADDR $IPADDR $IPADDR + ;; + + *GetHostname*) + printf " + + false + %s + + " $(hostname) + ;; + + *GetNetworkProtocols*) + printf " + + HTTP + true + 80 + + + RTSP + true + 554 + + + HTTPS + false + 443 + + " + ;; + + *GetNetworkDefaultGateway*) + printf " + + %s + + " $(route | awk '/default/{print substr($2,1)}') + ;; + + *SystemReboot*) + printf " + Rebooting now. + " + reboot + ;; + + *GetDiscoveryMode*) + printf " + Discoverable + " + ;; + + *GetUsers*) + printf "" + cat /etc/passwd | while read USER; do + case $(echo $USER | cut -d: -f3) in + 0) GROUP="Administrator" ;; + *) GROUP="User" ;; + esac + printf " + %s + %s + " $(echo $USER | cut -d: -f1) $GROUP + done + printf "" + ;; + + *) + printf " + + env:Receiver + + ter:ActionNotSupported + + + + ActionNotSupported + + + The device do NOT support this feature. + + " + ;; +esac + +printf "" diff --git a/src/wsdiscovery/wsdiscovery/onvif/media_service b/src/wsdiscovery/wsdiscovery/onvif/media_service new file mode 100755 index 0000000..6f3744c --- /dev/null +++ b/src/wsdiscovery/wsdiscovery/onvif/media_service @@ -0,0 +1,257 @@ +#!/bin/sh +POST_STRING=$(cat) +printf "Content-type: application/soap+xml\r\n\r\n" + +case $POST_STRING in + *GetProfiles*) + printf " + + MainStream + + VideoSourceConfig + 2 + VideoSource_1 + + + + VideoEncoder_0 + 1 + H264 + + 1920 + 1080 + + 5 + + 25 + 25 + 3072 + + + 25 + Main + + + + IPv4 + 0.0.0.0 + + 0 + 3 + false + + PT0S + + + + SubStream + + VideoSourceConfig + 2 + VideoSource_1 + + + + VideoEncoder_1 + 1 + H264 + + 640 + 360 + + 5 + + 15 + 15 + 512 + + + 15 + Main + + + + IPv4 + 239.255.0.0 + + 1024 + 1 + false + + PT5S + + + " + ;; + + *GetVideoSources*) + printf " + + 25 + + 1920 + 1080 + + + " + ;; + + *GetProfile*) + case $POST_STRING in + *profile_0*) + PROFILE=0 + WIDTH=1920 + HEIGHT=1080 + ;; + *profile_1*) + PROFILE=1 + WIDTH=640 + HEIGHT=360 + ;; + esac + printf " + + MainStream + + VideoSourceConfig + 2 + VideoSource_1 + + + + VideoEncoder_%i + 1 + H264 + + %i + %i + + 5 + + 25 + 25 + 3072 + + + 25 + Main + + + + IPv4 + 239.255.0.0 + + 1024 + 1 + false + + PT5S + + + " $PROFILE $HEIGHT $WIDTH $PROFILE $PROFILE $HEIGHT $WIDTH + ;; + + *GetStreamUri*) + case $POST_STRING in + *profile_0*) + RTSPPATH="ch0_0.h264" + ;; + *profile_1*) + RTSPPATH="ch0_1.h264" + ;; + esac + printf " + + rtsp://%s/%s + true + true + PT5S + + " $(ifconfig | awk '/inet addr/{print substr($2,6)}') $RTSPPATH + ;; + + *GetSnapshotUri*) + + ;; + + *GetVideoEncoderConfigurationOptions*) + printf " + + + 1 + 6 + + + + 640 + 360 + + + 1920 + 1080 + + + 1 + 100 + + + 1 + 30 + + + 1 + 25 + + Main + Baseline + Extended + High + + + " + ;; + + *GetVideoSourceConfiguration*) + printf " + + + VideoSourceConfig + + + 2 + + + VideoSource_1 + + + + + " + ;; + + *) + printf " + + env:Receiver + + ter:ActionNotSupported + + + + ActionNotSupported + + + The device do NOT support this feature. + + " + ;; + +esac + +printf "" diff --git a/src/wsdiscovery/wsdiscovery/wsdiscovery b/src/wsdiscovery/wsdiscovery/wsdiscovery new file mode 100755 index 0000000000000000000000000000000000000000..5feae743b9549a6062a61d7d194f49fadd2374f9 GIT binary patch literal 9808 zcmeHN4QyN06~0cK)(tJVe>4lFyre0lTWr7ll!cH6r+=hUQcM%7OskZ<*e{8}_VfH+ znnbI#r0rNI)uLq?DnpYE8xkNiqS2|7H zkRB>`ndno$#q(+wf+zngt$Kuw-C@x*9`c!N^F;tt2DlTj9IzI!8gLVU%2xol7}T|Y zDAq@!s1AyHee-naIRZfwixGZBba6i}n40w&>zY2bYK_OH zQ?5M+ew^dCfj`Od)!@%?{5#;^;`p_uYSc0&0BDTwbM3`w=g0Q}+G$S(3|SZZBk*NT zz8$>tAbwCt*HZvD#~%m3n&Zd7S91Kf!Pjy840wM0w6^?Q`%dt!9N!JTljCol=l}C) z4{`0C;Nu+seeioZ{xtZ596t?y)}N(p%{={WXdmO`8^NbJp7z9x9DgtR+eH9D>+yB2 zoy~4-RZB$V7*l0URf3Nwag7BdiYl|H97P?AN|A^XWIf?nh^Y}-jiLP;Ww(uk_Xus5PAVLMpc9tGA0ss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@)JA|$uQY}@kWp5Y&;8F6 T$xtCoHtljR +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MULTICAST_PORT 3702 +#define MULTICAST_GROUP "239.255.255.250" +#define UUID_SIZE 37 +#define BUF_SIZE 2048 + +int cnt = 1; +char uuid[UUID_SIZE]; +char addressBuffer[INET_ADDRSTRLEN]; +char name[UUID_SIZE]; +char hex[16] = "0123456789abcdef"; + +int check_link(const char *ifname) { + int state = -1; + int socId = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); + int rv; + if ((socId < 0) < 0) + perror("Socket failed"); + + struct ifreq if_req; + (void) strncpy(if_req.ifr_name, ifname, sizeof(if_req.ifr_name)); + + if ((rv = ioctl(socId, SIOCGIFFLAGS, &if_req)) == -1) + perror("Ioctl failed"); + + close(socId); + + return (if_req.ifr_flags & IFF_UP) && (if_req.ifr_flags & IFF_RUNNING); +} + +void get_uuid(char *buf) +{ + int i = 0; + while(i < 36) { + /* Format has to be xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx */ + if(i == 8 || i == 13 || i ==18 || i == 23) + buf[i] = '-'; + else if(i == 14) + buf[i] = '4'; + else + buf[i] = hex[rand() % 16]; + ++i; + } +} + +void get_msgid(char *buf) +{ + strcpy(buf, uuid); + int i = 9; + while(i < 36) { + if(i == 13 || i ==18 || i == 23) + buf[i] = '-'; + else if(i == 14) + buf[i] == '4'; + else + buf[i] = hex[rand() % 16]; + ++i; + } +} + +static void signal_callback(int signum) +{ + ++cnt; + int addrlen, bye_sock, family, s; + struct sockaddr_in bye_addr; + + bzero(&bye_addr,sizeof(bye_addr)); + bye_addr.sin_family = AF_INET; + bye_addr.sin_addr.s_addr=htonl(INADDR_ANY); + bye_addr.sin_port = htons(MULTICAST_PORT); + addrlen = sizeof(bye_addr); + + if ((bye_sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { + perror("socket failed"); + exit(1); + } + + char msgid[UUID_SIZE]; + char msgchar[BUF_SIZE]; + get_msgid(msgid); + + /* Send our SOAP Goodbye Mesage */ + bye_addr.sin_addr.s_addr = inet_addr(MULTICAST_GROUP); + sprintf(msgchar, "urn:uuid:%shttp://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousurn:schemas-xmlsoap-org:ws:2005:04:discoveryhttp://schemas.xmlsoap.org/ws/2005/04/discovery/Byeurn:uuid:%stdn:NetworkVideoTransmitteronvif://www.onvif.org/name/%s onvif://www.onvif.org/Profile/Streaminghttp://%s/onvif/device_service0", msgid, cnt, uuid, name, addressBuffer); + if (sendto(bye_sock, msgchar, strlen(msgchar), 0, (struct sockaddr *) &bye_addr, addrlen) < 0) { + perror("sendto"); + exit(1); + } + + exit(1); +} + +char * extract_between(const char *str, const char *p1, const char *p2) +{ + const char *i1 = strstr(str, p1); + if(i1 != NULL) + { + const size_t pl1 = strlen(p1); + const char *i2 = strstr(i1 + pl1, p2); + if(p2 != NULL) + { + /* Found both markers, extract text. */ + const size_t mlen = i2 - (i1 + pl1); + char *ret = malloc(mlen + 1); + if(ret != NULL) + { + memcpy(ret, i1 + pl1, mlen); + ret[mlen] = '\0'; + return ret; + } + } + } +} + +int main(int argc, const char * argv[]) { + + int addrlen, sock, family, s; + struct sockaddr_in addr; + struct ip_mreq mreq; + struct ifaddrs * ifAddrStruct = NULL; + struct ifaddrs * ifa = NULL; + void * tmpAddrPtr = NULL; + char msgid[UUID_SIZE]; + char msgchar[BUF_SIZE]; + + srand((unsigned int) time(0)); /* Setting Time as random seed */ + strcat(name, argv[2]); + + signal(SIGTERM, signal_callback); /* Handler for Sigterm */ + signal(SIGINT, signal_callback); /* and Sigint */ + + bzero(&addr,sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr=htonl(INADDR_ANY); + addr.sin_port = htons(MULTICAST_PORT); + addrlen = sizeof(addr); + + while (strlen(addressBuffer) == 0) { /* check if we allready have an valid IPv4 address assigned */ + if (getifaddrs(&ifAddrStruct) == -1) + { + perror("getifaddrs"); + exit(1); + } + for (ifa = ifAddrStruct; ifa != NULL; ifa = ifa->ifa_next) { + if ((strcmp(ifa->ifa_name,argv[1])==0)&&ifa ->ifa_addr->sa_family==AF_INET) { /* Check it is a valid IPv4 address */ + tmpAddrPtr = &((struct sockaddr_in *)ifa->ifa_addr)->sin_addr; + inet_ntop(AF_INET, tmpAddrPtr, addressBuffer, INET_ADDRSTRLEN); + } + } + if(strlen(addressBuffer) == 0) /* Sleep for one secound if we still didnt get an valid IPv4 address */ + sleep(1); + } + + if (ifAddrStruct != NULL) + freeifaddrs(ifAddrStruct); + + if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { + perror("socket failed"); + exit(1); + } + + if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) == -1) { + perror("bind failed"); + exit(1); + } + + mreq.imr_multiaddr.s_addr = inet_addr(MULTICAST_GROUP); /* Set Multicast IP address */ + mreq.imr_interface.s_addr = inet_addr(addressBuffer); /* Set interface for Multicast subscription */ + if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&mreq, sizeof(mreq)) == -1) { + perror("Error joining multicast group"); + exit(1); + } + + get_uuid(uuid); /* Get our UUID for this session */ + get_msgid(msgid); /* Get the first Message ID for this session */ + + /* Send the XML-SOAP Hello message */ + sprintf(msgchar, "urn:uuid:%shttp://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousurn:schemas-xmlsoap-org:ws:2005:04:discoveryhttp://schemas.xmlsoap.org/ws/2005/04/discovery/Hellourn:uuid:%stdn:NetworkVideoTransmitteronvif://www.onvif.org/name/%s onvif://www.onvif.org/Profile/Streaminghttp://%s/onvif/device_service0", msgid, cnt, uuid, name, addressBuffer); + addr.sin_addr.s_addr = inet_addr(MULTICAST_GROUP); + if (sendto(sock, msgchar, strlen(msgchar), 0, (struct sockaddr *) &addr, addrlen) < 0) { + perror("sendto"); + exit(1); + } + + while (1) { + char buf[BUF_SIZE] = ""; + + if (recvfrom(sock, buf, sizeof(buf), 0, (struct sockaddr *) &addr, &addrlen) < 0) { + perror("recvfrom"); + exit(1); + } + if(strstr(buf, "NetworkVideoTransmitter") && !strstr(buf, "XAddrs")) { + ++cnt; + char msgchar[BUF_SIZE] = ""; + char msgid[UUID_SIZE] = ""; + get_uuid(msgid); /* Get a new Message ID */ + + sprintf(msgchar, "urn:uuid:%s%shttp://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymoushttp://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymoushttp://schemas.xmlsoap.org/ws/2005/04/discovery/ProbeMatchesurn:uuid:%stdn:NetworkVideoTransmitteronvif://www.onvif.org/name/%s onvif://www.onvif.org/Profile/Streaminghttp://%s/onvif/device_service0", msgid, extract_between(buf, "", ""), cnt, uuid, name, addressBuffer ); + if (sendto(sock, msgchar, strlen(msgchar), 0, (struct sockaddr *) &addr, addrlen) < 0) { + perror("sendto"); + exit(1); + } + + } + } +} \ No newline at end of file From 444c528632a981a711a8ec32e2de45ac481180bf Mon Sep 17 00:00:00 2001 From: gaggi Date: Mon, 25 Feb 2019 14:07:22 +0100 Subject: [PATCH 7/9] Added build scripts --- .../static/home/yi-hack-v4/etc/system.conf | 2 +- .../static/home/yi-hack-v4/script/system.sh | 4 +- src/wsdiscovery/compile.wsdiscovery | 4 +- src/wsdiscovery/install.wsdiscovery | 2 +- .../wsdiscovery/onvif/media_service | 82 +++++++++---------- 5 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/static/static/home/yi-hack-v4/etc/system.conf b/src/static/static/home/yi-hack-v4/etc/system.conf index fd816c4..cfedf19 100755 --- a/src/static/static/home/yi-hack-v4/etc/system.conf +++ b/src/static/static/home/yi-hack-v4/etc/system.conf @@ -4,4 +4,4 @@ DROPBEAR=yes FTPD=yes PROXYCHAINSNG=no CHECK_UPDATES=yes -WSDD=yes +WSD=yes diff --git a/src/static/static/home/yi-hack-v4/script/system.sh b/src/static/static/home/yi-hack-v4/script/system.sh index 036a01f..a92dc74 100755 --- a/src/static/static/home/yi-hack-v4/script/system.sh +++ b/src/static/static/home/yi-hack-v4/script/system.sh @@ -40,8 +40,8 @@ if [[ $(get_config DROPBEAR) == "yes" ]] ; then dropbear -R fi -if [[ $(get_config WSDD) == "yes" ]] ; then - dropbear -R +if [[ $(get_config WSD) == "yes" ]] ; then + wsdiscovery wlan0 $(cat /home/app/.camver) fi # First run on startup, then every hour via crond diff --git a/src/wsdiscovery/compile.wsdiscovery b/src/wsdiscovery/compile.wsdiscovery index 237fa9e..004c2a7 100755 --- a/src/wsdiscovery/compile.wsdiscovery +++ b/src/wsdiscovery/compile.wsdiscovery @@ -11,8 +11,8 @@ make mkdir -p ../_install cp wsdiscovery ../_install -mkdir -p ../_install/onvif +mkdir -p ../_install/www/onvif echo "Copying the onvif folder..." -cp ./onvif/* ../_install/onvif +cp ./onvif/* ../_install/www/onvif echo "Compilation succeeded." \ No newline at end of file diff --git a/src/wsdiscovery/install.wsdiscovery b/src/wsdiscovery/install.wsdiscovery index b79128d..2160b05 100755 --- a/src/wsdiscovery/install.wsdiscovery +++ b/src/wsdiscovery/install.wsdiscovery @@ -4,4 +4,4 @@ SCRIPT_DIR=$(cd `dirname $0` && pwd) cd $SCRIPT_DIR rsync -a ./_install/wsdiscovery ../../build/home/yi-hack-v4/bin/ -rsync -a ./_install/onvif/* ../../build/home/yi-hack-v4/www/onvif/ \ No newline at end of file +rsync -a ./_install/www/* ../../build/home/yi-hack-v4/www/ \ No newline at end of file diff --git a/src/wsdiscovery/wsdiscovery/onvif/media_service b/src/wsdiscovery/wsdiscovery/onvif/media_service index 6f3744c..3f9eeef 100755 --- a/src/wsdiscovery/wsdiscovery/onvif/media_service +++ b/src/wsdiscovery/wsdiscovery/onvif/media_service @@ -1,5 +1,17 @@ #!/bin/sh POST_STRING=$(cat) + +case $(cat /home/app/.camver) in + *1080*) + MAINWIDTH=1920 + MAINHEIGHT=1080 + ;; + *) + MAINWIDTH=1280 + MAINHEIGHT=720 + ;; +esac + printf "Content-type: application/soap+xml\r\n\r\n" case $POST_STRING in @@ -11,24 +23,24 @@ case $POST_STRING in VideoSourceConfig 2 VideoSource_1 - + VideoEncoder_0 1 H264 - 1920 - 1080 + %i + %i 5 - 25 - 25 + 20 + 20 3072 - 25 + 20 Main @@ -61,12 +73,12 @@ case $POST_STRING in 5 - 15 - 15 + 20 + 20 512 - 15 + 20 Main @@ -81,28 +93,28 @@ case $POST_STRING in PT5S - " + " $MAINWIDTH $MAINHEIGHT $MAINWIDTH $MAINHEIGHT ;; *GetVideoSources*) printf " - 25 + 20 - 1920 - 1080 + %i + %i - " + " $MAINWIDTH $MAINHEIGHT ;; *GetProfile*) case $POST_STRING in *profile_0*) PROFILE=0 - WIDTH=1920 - HEIGHT=1080 + WIDTH=$MAINWIDTH + HEIGHT=$MAINHEIGHT ;; *profile_1*) PROFILE=1 @@ -117,15 +129,15 @@ case $POST_STRING in VideoSourceConfig 2 VideoSource_1 - + VideoEncoder_%i 1 H264 - %i %i + %i 5 @@ -149,7 +161,7 @@ case $POST_STRING in PT5S - " $PROFILE $HEIGHT $WIDTH $PROFILE $PROFILE $HEIGHT $WIDTH + " $PROFILE $WIDTH $HEIGHT $PROFILE $PROFILE $WIDTH $HEIGHT ;; *GetStreamUri*) @@ -188,8 +200,8 @@ case $POST_STRING in 360 - 1920 - 1080 + %i + %i 1 @@ -209,30 +221,18 @@ case $POST_STRING in High - " + " $MAINWIDTH $MAINHEIGHT ;; *GetVideoSourceConfiguration*) printf " - - - VideoSourceConfig - - - 2 - - - VideoSource_1 - - - - - " + + VideoSourceConfig + 2 + VideoSource_1 + + + " $MAINWIDTH $MAINHEIGHT ;; *) From ecf5ef8e2f092d1acb0ec2b457e922c4d24e7887 Mon Sep 17 00:00:00 2001 From: gaggi Date: Mon, 25 Feb 2019 16:02:36 +0100 Subject: [PATCH 8/9] Cleanup --- src/wsdiscovery/wsdiscovery/.gitignore | 1 + src/wsdiscovery/wsdiscovery/wsdiscovery | Bin 9808 -> 0 bytes 2 files changed, 1 insertion(+) create mode 100644 src/wsdiscovery/wsdiscovery/.gitignore delete mode 100755 src/wsdiscovery/wsdiscovery/wsdiscovery diff --git a/src/wsdiscovery/wsdiscovery/.gitignore b/src/wsdiscovery/wsdiscovery/.gitignore new file mode 100644 index 0000000..7dc40d0 --- /dev/null +++ b/src/wsdiscovery/wsdiscovery/.gitignore @@ -0,0 +1 @@ +wsdiscovery diff --git a/src/wsdiscovery/wsdiscovery/wsdiscovery b/src/wsdiscovery/wsdiscovery/wsdiscovery deleted file mode 100755 index 5feae743b9549a6062a61d7d194f49fadd2374f9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9808 zcmeHN4QyN06~0cK)(tJVe>4lFyre0lTWr7ll!cH6r+=hUQcM%7OskZ<*e{8}_VfH+ znnbI#r0rNI)uLq?DnpYE8xkNiqS2|7H zkRB>`ndno$#q(+wf+zngt$Kuw-C@x*9`c!N^F;tt2DlTj9IzI!8gLVU%2xol7}T|Y zDAq@!s1AyHee-naIRZfwixGZBba6i}n40w&>zY2bYK_OH zQ?5M+ew^dCfj`Od)!@%?{5#;^;`p_uYSc0&0BDTwbM3`w=g0Q}+G$S(3|SZZBk*NT zz8$>tAbwCt*HZvD#~%m3n&Zd7S91Kf!Pjy840wM0w6^?Q`%dt!9N!JTljCol=l}C) z4{`0C;Nu+seeioZ{xtZ596t?y)}N(p%{={WXdmO`8^NbJp7z9x9DgtR+eH9D>+yB2 zoy~4-RZB$V7*l0URf3Nwag7BdiYl|H97P?AN|A^XWIf?nh^Y}-jiLP;Ww(uk_Xus5PAVLMpc9tGA0ssVOCDV~o@wWJYj)vu|p4*ezLjUOG+xh&(KLK3sC-lz3l>Q>9Af$6I3!@nU{LgECmst&57#N)_ zX;0}zhtrwM`(R)Ev+h!XS$hsSs&oZ(oPrJqi{~yCq>8Z2ihDLDvo8M+Cb80U*apQ; zHl{n_+c@N~3v$>>rHkET`Z)VTrT{#i`K3`9o!naVFAD@;zaKvEw;y<2=j zr!gLLq;x+p#k~T$sVxC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9E+}gf-_Hr_EBm`4PT>AwXd_SwcR+>dBWDy zdA8T=;cf0&k?Um(|DPNZBa$YoI78W|$eprX^FMrwyzVJ)-r4@D=h*-3!4k)#9=T1@ zuu|=F^A~u+HxfML!c@t0I8a40H&mA!DwOjVlOFr)Op%m}?#vS@f zU@G{|#TMfm0=^L$2I;PPDS+; z_mYSAZ{FM>RNlYiq4h$ox7J%D(5HiHylV=TTjZXw6cgeJynIDuNtM@I(k)>%90>=N zSl6CfQCu(7dF#Ek=vZA_T_e^Am3)t8TuLxWmU_a>L32~Ip<^psP~>tfax8PMaIAE! zDlBo77BH{cj~hu%>S12I@yUre^Y%+>Kl6r$W9o3!#JIBb!WVBmqLCObQoWiygx_8; zXi|*pORwB-UO}2NT~Z<;4VyAH{csSPpc!vwLFVmKpu+5mi%;eaD$%GMLtXREHm{^< ziEz&V9usyLuZwAIQEX`~T^a!Z(|WRty)y7kiWLD!j@GIR4SoQvMJo0>rnOEwNsiWV z3y8x2YA0QUamC5X0MwV{Xw9EP1Fdzt*yMUt;QON?M{BzZAG$~p^~Lu{bMFAxnAOIA zLTK+*p^@y^h3r!C07y5fG1fWc#%yD#BRPV4fGtPg%+KOJw*p`nTVE3=M|=Gej9$&| z7E6x&r0>5@Y}k$5pIpcmL92x+E?d$7!Sn~LQEa=rz|ntDC=QfcT7;|1^`M>1kR0Wl z)@#Vc&`$PAj=qlvt|3P&i(*G|=Kqk){~+0Z5vDNh1=#v1S1m5X{W9w8LUIJ709)=T zm)_MTmAy_ix%FWEKk7jUm_3jy15WP|jHR@*V?>$Ye@)JA|$uQY}@kWp5Y&;8F6 T$xtCoHtljR Date: Mon, 25 Feb 2019 16:05:50 +0100 Subject: [PATCH 9/9] Further cleanup --- .gitmodules | 3 ++- src/busybox/init.busybox | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index b843db0..f3bb541 100755 --- a/.gitmodules +++ b/.gitmodules @@ -12,4 +12,5 @@ url = https://github.com/rofl0r/proxychains-ng.git [submodule "src/ftpd/pure-ftpd"] path = src/ftpd/pure-ftpd - url = https://github.com/jedisct1/pure-ftpd.git \ No newline at end of file + url = https://github.com/jedisct1/pure-ftpd.git + diff --git a/src/busybox/init.busybox b/src/busybox/init.busybox index 276c328..9c8a481 100755 --- a/src/busybox/init.busybox +++ b/src/busybox/init.busybox @@ -1,4 +1,4 @@ -#/bin/bash +#!/bin/bash SCRIPT_DIR=$(cd `dirname $0` && pwd) cd $SCRIPT_DIR