]> git.webhop.me Git - bs-cst-neutrino-hd.git/commitdiff
add no-ip update script, enable crond in busybox, enable ssl in curl
authorwittinobi <wittinobi@two1>
Sun, 20 Apr 2014 12:11:41 +0000 (14:11 +0200)
committerwittinobi <wittinobi@two1>
Sun, 20 Apr 2014 12:11:41 +0000 (14:11 +0200)
archive-patches/busybox-1.22.1-hd1.config
make/libraries.mk
skel-root/bin/no-ip.sh [new file with mode: 0755]
skel-root/etc/cron/crontabs/cronjobs [new file with mode: 0755]
skel-root/etc/init.d/rcS.local
skel-root/mnt/mnt0/.gitignore [new file with mode: 0644]
skel-root/mnt/mnt1/.gitignore [new file with mode: 0644]
skel-root/mnt/mnt2/.gitignore [new file with mode: 0644]
skel-root/mnt/mnt3/.gitignore [new file with mode: 0644]

index 7592a7d577055619d6ca9ccee7fe4ff2b7d7d82a..de8d3e9230a7f4a7def8c67718e775a2bac53be0 100644 (file)
@@ -675,11 +675,11 @@ CONFIG_FEATURE_BEEP_LENGTH_MS=0
 # CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set
 # CONFIG_FEATURE_CHAT_CLR_ABORT is not set
 # CONFIG_CHRT is not set
-# CONFIG_CROND is not set
+CONFIG_CROND=y
 # CONFIG_FEATURE_CROND_D is not set
 # CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
-CONFIG_FEATURE_CROND_DIR=""
-# CONFIG_CRONTAB is not set
+CONFIG_FEATURE_CROND_DIR="/etc/cron"
+CONFIG_CRONTAB=y
 # CONFIG_DC is not set
 # CONFIG_FEATURE_DC_LIBM is not set
 # CONFIG_DEVFSD is not set
index fe90f81e77ac30243bf942ad86e58871e75291ea..48f74b2ddfe62366942c2958e97717dde2ec8e48 100755 (executable)
@@ -126,7 +126,7 @@ $(D)/libcurl: $(ARCHIVE)/curl-7.35.0.tar.bz2 | $(TARGETPREFIX)
        pushd $(BUILD_TMP)/curl-7.35.0 && \
                $(CONFIGURE) --prefix= --build=$(BUILD) --host=$(TARGET) \
                        --disable-manual --disable-file --disable-rtsp --disable-dict \
-                       --disable-imap --disable-pop3 --disable-smtp --without-ssl \
+                       --disable-imap --disable-pop3 --disable-smtp --with-ssl \
                        --with-random --mandir=/.remove && \
                $(MAKE) all && \
                mkdir -p $(HOSTPREFIX)/bin && \
diff --git a/skel-root/bin/no-ip.sh b/skel-root/bin/no-ip.sh
new file mode 100755 (executable)
index 0000000..1912864
--- /dev/null
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+USERAGENT="Simple No-IP Update Script"
+USERNAME=username%40web.de
+PASSWORD=password
+HOST=yourhost.no-ip.org
+LOGFILE=/tmp/no-ip.log
+SAVEDIP=/tmp/no-ip.savedip
+TIMENOW=/tmp/no-ip.timenow
+TIMESTART=/tmp/no-ip.timestart
+TIMER=/tmp/no-ip.timer
+FORCEDUPDATE=25
+FAKEIP=1.2.3.4
+ACTUALIP=$(curl -s -k "https://www.wittinobi.de/meine-ip.php")
+
+echo "$(date +"%d")" > $TIMENOW
+
+if [ ! -e $SAVEDIP ]; then
+       touch $SAVEDIP
+fi
+
+if [ ! -e $TIMESTART ]; then
+       echo "$(date +"%d")" > $TIMESTART
+fi
+
+if [ ! -e $TIMER ]; then
+       echo "0" > $TIMER
+fi
+
+if [ "$(cat $TIMESTART)" != "$(cat $TIMENOW)" ]; then
+       echo "$(expr $(cat $TIMER) + 1)" > $TIMER
+       echo "$(date +"%d")" > $TIMESTART
+fi
+
+if [ "$(cat $TIMER)" == "$FORCEDUPDATE" ]; then
+       echo "[$(date +"%Y-%m-%d %H:%M:%S")] No IP change 25 days !!!" >> $LOGFILE
+       echo "[$(date +"%Y-%m-%d %H:%M:%S")] Send FAKEIP" >> $LOGFILE
+       IPSTATUS=$(curl -s -k "https://$USERNAME:$PASSWORD@dynupdate.no-ip.com/nic/update?hostname=$HOST&myip=$FAKEIP")
+       echo "[$(date +"%Y-%m-%d %H:%M:%S")] $IPSTATUS" >> $LOGFILE
+       echo "[$(date +"%Y-%m-%d %H:%M:%S")] Send NEWIP" >> $LOGFILE
+       IPSTATUS=$(curl -s -k "https://$USERNAME:$PASSWORD@dynupdate.no-ip.com/nic/update?hostname=$HOST&myip=$ACTUALIP")
+       echo "[$(date +"%Y-%m-%d %H:%M:%S")] $IPSTATUS" >> $LOGFILE
+       echo $ACTUALIP > $SAVEDIP
+       echo "0" > $TIMER
+       echo "$(date +"%d")" > $TIMESTART
+       echo "--------------------------------------------------------" >> $LOGFILE
+       echo "" >> $LOGFILE
+else
+       if [ "$ACTUALIP" != "$(cat $SAVEDIP)" ]; then
+               echo "[$(date +"%Y-%m-%d %H:%M:%S")] IP change !!!" >> $LOGFILE
+               echo "[$(date +"%Y-%m-%d %H:%M:%S")] Send NEWIP" >> $LOGFILE
+               IPSTATUS=$(curl -s -k "https://$USERNAME:$PASSWORD@dynupdate.no-ip.com/nic/update?hostname=$HOST&myip=$ACTUALIP")
+               echo "[$(date +"%Y-%m-%d %H:%M:%S")] $IPSTATUS" >> $LOGFILE
+               echo $ACTUALIP > $SAVEDIP
+               echo "--------------------------------------------------------" >> $LOGFILE
+               echo "" >> $LOGFILE
+       else
+               echo "[$(date +"%Y-%m-%d %H:%M:%S")] No IP change !!!" >> $LOGFILE
+               echo $ACTUALIP > $SAVEDIP
+               echo "--------------------------------------------------------" >> $LOGFILE
+               echo "" >> $LOGFILE
+       fi
+fi
+
+exit 0
diff --git a/skel-root/etc/cron/crontabs/cronjobs b/skel-root/etc/cron/crontabs/cronjobs
new file mode 100755 (executable)
index 0000000..1bab7e5
--- /dev/null
@@ -0,0 +1 @@
+*/5 * * * * /bin/no-ip.sh
index 4c165cffb55549d6776d72566ea03b9b18ec162d..cad218873e219cdbf4936f2929c558071bc1e871 100755 (executable)
@@ -1,6 +1,11 @@
 #!/bin/sh
 export PATH=/sbin:/bin:/usr/bin:/usr/sbin
 
+#crond starten
+if [ -e /var/etc/.crond ]; then
+       /bin/busybox crond &
+fi
+
 #tuxcal starten
 if [ -e /bin/tuxcald ]; then
        /bin/tuxcald &
@@ -11,6 +16,11 @@ if [ -e /bin/tuxmaild ]; then
        /bin/tuxmaild &
 fi
 
+#no-ip starten
+if [ -e /var/etc/.no-ip ]; then
+       /bin/no-ip.sh &
+fi
+
 #inadyn starten
 if [ -e /var/etc/.inadyn ]; then
        /bin/inadyn &
diff --git a/skel-root/mnt/mnt0/.gitignore b/skel-root/mnt/mnt0/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/skel-root/mnt/mnt1/.gitignore b/skel-root/mnt/mnt1/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/skel-root/mnt/mnt2/.gitignore b/skel-root/mnt/mnt2/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/skel-root/mnt/mnt3/.gitignore b/skel-root/mnt/mnt3/.gitignore
new file mode 100644 (file)
index 0000000..e69de29