]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/nslu2-binary-only/unslung-rootfs/resling
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / nslu2-binary-only / unslung-rootfs / resling
1 #!/bin/sh
2 #
3 # Copyright (C) 2004 by Oleg I. Vdovikin <oleg@cs.msu.su>
4 # Modified for Unslung by Rod Whitby
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #
20
21 if [ -f /share/flash/data/resling.tar.gz ] ; then
22     RESLING=/share/flash/data/resling.tar.gz
23 elif   [ -f /share/hdd/data/resling.tar.gz ] ; then
24     RESLING=/share/hdd/data/resling.tar.gz
25 elif [ -f /share/flash/conf/resling.tar.gz ] ; then
26     RESLING=/share/flash/conf/resling.tar.gz
27 elif   [ -f /share/hdd/conf/resling.tar.gz ] ; then
28     RESLING=/share/hdd/conf/resling.tar.gz
29 else
30     RESLING=/share/flash/data/resling.tar.gz
31 fi
32
33 case "$1" in
34         start)
35                 if [ -f ${RESLING} ]; then
36                         tar -C / -zxf ${RESLING}
37                 fi
38                 ;;
39         clear)
40                 rm -f ${RESLING}
41                 ;;
42         load)
43                 tar -C / -zxvf ${RESLING}
44                 ;;
45         list)
46                 tar -C / -ztf ${RESLING}
47                 ;;
48         save)
49                 [ -f /unslung/.files ] && FILES=$(cat /unslung/.files)
50                 rm -f /tmp/resling.tar.gz
51                 tar -C / -zcvf /tmp/resling.tar.gz /unslung $FILES && 
52                 rm -f ${RESLING} &&
53                 mv /tmp/resling.tar.gz ${RESLING} &&
54                 ls -l ${RESLING} &&
55                 echo "Saved."
56                 ;;
57         *)
58                 echo "Usage: $0 start|clear|load|list|save"
59                 ;;
60 esac