1 |
7ec0aeb1
|
Scott Ullrich
|
#!/bin/sh
|
2 |
|
|
|
3 |
60e014fe
|
Scott Ullrich
|
echo -n "Checking..."
|
4 |
979f35f3
|
Scott Ullrich
|
if [ `tar tzPf $1 /etc/rc 2>/dev/null` ]; then
|
5 |
60e014fe
|
Scott Ullrich
|
echo " Backup file looks OK."
|
6 |
1f06d217
|
Scott Ullrich
|
echo "One moment, restoring ${1}..."
|
7 |
b8bfcce5
|
Scott Ullrich
|
if [ -f /tmp/do_not_restore_config.xml ]; then
|
8 |
|
|
EXCLUDE="--exclude /cf/conf/config.xml"
|
9 |
|
|
rm /tmp/do_not_restore_config.xml
|
10 |
|
|
else
|
11 |
e173dd74
|
Phil Davis
|
EXCLUDE=""
|
12 |
b8bfcce5
|
Scott Ullrich
|
fi
|
13 |
|
|
tar xzPfU $1 $EXCLUDE -C / 2>/var/etc/restore_log.txt
|
14 |
813d71c1
|
Chris Buechler
|
echo "Restore of $1 complete. Rebooting"
|
15 |
|
|
/sbin/reboot
|
16 |
979f35f3
|
Scott Ullrich
|
else
|
17 |
60e014fe
|
Scott Ullrich
|
echo " Error."
|
18 |
|
|
echo "File not found or invalid backup file. Available backups:"
|
19 |
6cf2e475
|
Scott Ullrich
|
ls -lah /root | grep backup | more
|
20 |
7ec0aeb1
|
Scott Ullrich
|
fi
|