add possibilty to compress content of multiple ipk files into loop mountable squashfs...
[opendreambox.git] / meta-opendreambox / recipes-dreambox / dreambox / dreambox-squashfs-support / dreambox-squashfs-support.sysvinit
1 #!/bin/sh
2
3 case "$1" in
4   start)
5     echo -n "Mounting squashfs images:"
6     [ ! -d /media ] && echo "re-creating missing /media dir!" && mkdir /media
7     [ ! -d /media/squashfs-images ] && echo "re-creating missing /media/squashfs-images dir!" && mkdir /media/squashfs-images
8     for i in `ls /squashfs-images`; do
9         [ ! -d /media/squashfs-images/$i ] && echo "re-creating missing /media/squashfs-images/$i dir!" && mkdir /media/squashfs-images/$i
10         [ ! $(mountpoint -q /media/squashfs-images/$i) ] && echo "loop mounting /squashfs-images/$i to /media/squashfs-images/$i" && mount -t squashfs -o ro,loop /squashfs-images/$i /media/squashfs-images/$i
11     done
12     ;;
13   stop|restart|reload|force-reload)
14     echo "/etc/init.d/dreambox-squashfs-support {stop|restart|reload|force-reload) not supported!"
15     ;;
16   *)
17     echo "Usage: /etc/init.d/dreambox-squashfs-support {start}"
18     exit 1
19 esac
20
21 exit 0