--- a
+++ b/scripts/S2handlewebupdate
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+TAR="/mnt/flash/root/bin/busybox tar"
+GZIP="/mnt/flash/root/bin/busybox gzip"
+UPDATEFILE=/mnt/flash/update/update.tgz
+MOUNTPOINT=/mnt/flash/update
+MKFS_JFFS2=/mnt/flash/root/bin/mkfs.jffs2
+MTDBLOCK=/dev/mtdblock7
+
+mount -t jffs2 $MTDBLOCK $MOUNTPOINT
+if [ ! -f $MOUNTPOINT/FORMATED ]; then
+   echo "formating "$MTDBLOCK
+   umount $MOUNTPOINT
+   mkdir /tmp/emptydir
+   $MKFS_JFFS2 -b -d /tmp/emptydir > $MTDBLOCK
+   mount -t jffs2 $MTDBLOCK $MOUNTPOINT
+   touch $MOUNTPOINT/FORMATED 
+fi
+
+if [ -f $UPDATEFILE ]; then
+  echo "found updatefile"
+  $GZIP -c -d $UPDATEFILE | $TAR x update_scripts/dowebupdate.sh -C /tmp
+  chmod +x /tmp/update_scripts/dowebupdate.sh
+  /tmp/update_scripts/dowebupdate.sh
+fi
+