All pastes #747734 Raw Edit

Anonym

public text v1 · immutable
·published 2007-10-24 09:24 UTC
rendered paste body
Index: cgi-bin/backup_restore.cgi
===================================================================
--- cgi-bin/backup_restore.cgi	(revision 1255)
+++ cgi-bin/backup_restore.cgi	(working copy)
@@ -28,6 +28,7 @@
 
 <form action="/cgi-bin/do_restore.cgi" method=POST enctype="multipart/form-data">
   <input type=file name="uploadfile"><br>
+  <input type=checkbox name="dsmod_only" checked>Nur Dsmod-Einstellungen wiederherstellen<p>
   <input type=checkbox name="restart" checked>Neustart nach Wiederherstellung<p>
   <input type=submit value="Wiederherstellen">
 </form>
Index: cgi-bin/do_restore.cgi
===================================================================
--- cgi-bin/do_restore.cgi	(revision 1255)
+++ cgi-bin/do_restore.cgi	(working copy)
@@ -18,10 +18,15 @@
     echo "Extracting backup files..."
     tar xvzf $FORM_uploadfile
     echo "Restoring configuration..."
-    for file in $(ls $BACKUP_DIR); do
-      echo "cat $BACKUP_DIR/$file > /var/flash/$file"
-      cat $BACKUP_DIR/$file > /var/flash/$file
-    done
+    if [ "$FORM_dsmod_only" = "on" ]; then
+      echo "cat $BACKUP_DIR/ds_mod > /var/flash/ds_mod"
+      cat $BACKUP_DIR/ds_mod > /var/flash/ds_mod
+    else
+      for file in $(ls $BACKUP_DIR); do
+        echo "cat $BACKUP_DIR/$file > /var/flash/$file"
+        cat $BACKUP_DIR/$file > /var/flash/$file
+      done
+    fi
     echo "done"
     echo "Removing backup..."
     rm -rf $BACKUP_DIR