Merge branch 'vuplus_experimental' of code.vuplus.com:/opt/repository/dvbapp into...
[vuplus_dvbapp] / lib / python / Plugins / Extensions / BackupSuiteUSB / backup.sh
1 #!/bin/sh
2
3 export LANG=$1
4 export HARDDISK=0
5 export SHOW="python /usr/lib/enigma2/python/Plugins/Extensions/BackupSuiteHDD/message.py $LANG"
6 TARGET="XX"
7 for candidate in /media/*
8 do
9         if [ -f "${candidate}/"*[Bb][Aa][Cc][Kk][Uu][Pp][Ss][Tt][Ii][Cc][Kk]* ]
10         then
11         TARGET="${candidate}"
12         fi 
13 done
14
15 if [ "$TARGET" = "XX" ] ; then
16         $SHOW "message21" #error about no USB-found
17 else
18         $SHOW "message22" 
19         SIZE_1="$(df -h "$TARGET" | tail -n 1 | awk {'print $4'})"
20         SIZE_2="$(df -h "$TARGET" | tail -n 1 | awk {'print $2'})"
21         echo -n " -> $TARGET ($SIZE_2, " ; $SHOW "message16" ; echo "$SIZE_1)"
22         backupsuite.sh "$TARGET" 
23         sync
24 fi