Create the self-extracting archive restore.sh
[backups/.git] / scripts / restore-script.sh
old mode 100644 (file)
new mode 100755 (executable)
index 402bb84..5ae9fe7
@@ -1,17 +1,21 @@
 #!/bin/sh
 
+echo "Ran restore script with $@"
+
+exit 0
+
+export PATH=$rundir:/bin:/usr/bin
+
 if [ $# != 1 ]; then
-  echo >&2 "Usage: $0 <target-directory>"
-  echo >&2 "Example: $0 /"
+  echo >&2 "Usage: $0 <source-directory> <target-directory>"
+  echo >&2 "Example: $0 / /"
   exit 1
 fi
 
-tmpdir=/tmp/restore-$(date +%Y%m%d%H%M%S)
-
-export PATH=$tmpdir:/bin:/usr/bin
-
 # Get the device with the CD in it here
-device=/dev/hdc
+device=$(mount | grep "on $mountdir " | awk '{print$1}')
+
+cp $mountdir/backups.db $mountdir
 
 for date in $(cat $dbfile | list-dates.sh); do
   eject $device