--- var/install	2008-01-01 19:00:00.000000000 -0500
+++ var/install	2008-04-04 19:04:00.000000000 -0400
@@ -0,0 +1,120 @@
+#! /bin/sh
+##################################################################################
+# install results:
+##################################################################################
+export INSTALL_SUCCESS_NO_REBOOT=0
+export INSTALL_SUCCESS_REBOOT=1
+export INSTALL_OTHER_ERROR=6
+export INSTALL_FIRMWARE_VERSION=7
+
+
+#   Wenn Update: HTML-Seite austauschen
+
+    rm -f /var/flash.html
+    cp /var/flash2.html /var/flash.html
+
+
+##################################################################################
+echo "install: check and install new firmware ..."
+LED_DEVICE=/proc/led_mod/led
+if [ ! -f /proc/led_mod/led  ] ; then
+    LED_DEVICE=/var/led 
+    echo "set led: ${LED_DEVICE}"
+fi
+need_reboot=$INSTALL_SUCCESS_NO_REBOOT
+##################################################################################
+# Power LED blinken lassen
+##################################################################################
+echo "set INFO led to blink (modul=7, state=4)"
+echo 7,4>${LED_DEVICE}
+################################
+# list of accepted installtypes:
+################################
+echo OEM=$OEM
+echo ANNEX=$ANNEX
+case `uname -r` in
+    2.4*)
+        echo "install: have Kernel 2.4";
+        exit $INSTALL_FIRMWARE_VERSION
+        ;;
+    2.6*)
+        echo "install: have Kernel 2.6";
+        ;;
+    *)
+        exit $INSTALL_OTHER_ERROR
+        ;;
+esac
+##################################################################################
+# DECT-Update handling >>>>
+##################################################################################
+echo MODE=update > /dev/avm_power
+if [ -x /var/dect_update ] && [ -e /var/dect_firmware.bin ] ; then
+ # Update: HTML-Seite austauschen
+ rm -f /var/flash.html
+ cp /var/flash2.html /var/flash.html
+ echo "trigger DECT-Update"
+ ##################################################################################
+ # prepare install
+ ##################################################################################
+ echo "#! /bin/sh" >/var/post_install
+ # append sequence to /var/post_install 
+ echo 'echo $0: start' >>/var/post_install
+ # LED- und Betriebsstundenzaehler- Demon stoppen
+ echo "sleep 1" >>/var/post_install
+ echo "killall run_clock" >>/var/post_install
+ echo "if ps | grep -v grep | grep -q telefon ; then killall telefon ; fi" >>/var/post_install
+ echo "if ps | grep -v grep | grep -q telnetd ; then killall telnetd ; fi" >>/var/post_install
+ # unmittelbar vor dem Flashen den Watchdog ausschalten
+ if [ -e /dev/watchdog ] ; then >>/var/post_install
+  echo "echo \"disable\" > /dev/watchdog" >>/var/post_install
+ fi >>/var/post_install
+ echo "echo \"-------------------------------------------------------------------------------\"" >>/var/post_install
+    echo 'dect_count=3' >> /var/post_install
+    echo 'while [ $dect_count -gt 0 ] &&  ! /var/dect_update -f /var/dect_firmware.bin  ; do' >> /var/post_install
+    echo '	echo " wait (dect update retry)"' >> /var/post_install
+    echo '	sleep 1' >> /var/post_install
+    echo '	dect_count=$((dect_count - 1))' >> /var/post_install
+    echo '	if [ "${dect_count}" = "0" ] ; then' >> /var/post_install
+    echo '		echo "dect update failed"' >> /var/post_install
+    echo '	fi' >> /var/post_install
+    echo 'done' >> /var/post_install
+ #print some info to the consl
+ echo "echo \"-------------------------------------------------------------------------------\"" >>/var/post_install
+ echo "echo \"cat /var/tmp/install_error.log\"" >>/var/post_install
+ echo "cat /var/tmp/install_error.log" >>/var/post_install
+ echo "echo \"-------------------------------------------------------------------------------\"" >>/var/post_install
+ echo "echo \"cat /var/tmp/install_out.log\"" >>/var/post_install
+ echo "cat /var/tmp/install_out.log" >>/var/post_install
+ echo "echo \"-------------------------------------------------------------------------------\"" >>/var/post_install
+ echo "echo \"cat /var/tmp/update_error.log\"" >>/var/post_install
+ echo "cat /var/tmp/update_error.log" >>/var/post_install
+ echo "echo \"-------------------------------------------------------------------------------\"" >>/var/post_install
+ echo "echo \"cat /var/tmp/update_out.log\"" >>/var/post_install
+ echo "cat /var/tmp/update_out.log" >>/var/post_install
+ echo "echo \"-------------------------------------------------------------------------------\"" >>/var/post_install
+ echo "sleep 1" >>/var/post_install
+ #make sure post_install is executable
+ chmod +x /var/post_install
+    need_reboot=$INSTALL_SUCCESS_REBOOT
+fi
+##################################################################################
+# DECT-Update handling <<<<
+##################################################################################
+if [ $need_reboot -eq $INSTALL_SUCCESS_REBOOT ] ; then
+    echo "set INFO led to blink (modul=7, state=4)"
+    echo 7,4>${LED_DEVICE}
+else
+    echo "set INFO led to off (modul=7, state=1)"
+    echo 7,1>${LED_DEVICE}
+fi
+##################################################################################
+#  returnwerte:  0 kein reboot,  1 reboot
+##################################################################################
+exit $need_reboot
+##################################################################################
+echo "****INSTALLSCRIPT STOPPED ON DEVICE FOR TESTING (disabling watchdog)****"
+if [ -e /dev/watchdog ] ; then 
+    echo "disable" > /dev/watchdog
+fi 
+exit 0
+##################################################################################
