| 1 | #!/bin/sh
|
|---|
| 2 | TMP=/tmp/.oscam
|
|---|
| 3 | INSTDIR="$1"
|
|---|
| 4 |
|
|---|
| 5 | sed s#_path_#"$INSTDIR"#g -i "$INSTDIR/etc/oscam_6089_swap.emu"
|
|---|
| 6 |
|
|---|
| 7 | if [ ! -e "$INSTDIR/keys/oscam.conf" ]; then
|
|---|
| 8 | echo "use ipk config file: oscam.conf"
|
|---|
| 9 | echo "rename $INSTDIR/keys/oscam.conf.oscam > $INSTDIR/keys/oscam.conf"
|
|---|
| 10 | mv "$INSTDIR/keys/oscam.conf.oscam" "$INSTDIR/keys/oscam.conf"
|
|---|
| 11 | else
|
|---|
| 12 | echo "found user config file: oscam.conf"
|
|---|
| 13 | echo "skip ipk config file: oscam.conf.oscam"
|
|---|
| 14 | fi
|
|---|
| 15 |
|
|---|
| 16 | if [ ! -e "$INSTDIR/keys/oscam.provid" ]; then
|
|---|
| 17 | echo "use ipk config file: oscam.provid"
|
|---|
| 18 | echo "rename $INSTDIR/keys/oscam.provid.oscam > $INSTDIR/keys/oscam.provid"
|
|---|
| 19 | mv "$INSTDIR/keys/oscam.provid.oscam" "$INSTDIR/keys/oscam.provid"
|
|---|
| 20 | else
|
|---|
| 21 | echo "found user config file: oscam.provid"
|
|---|
| 22 | echo "skip ipk config file: oscam.provid.oscam"
|
|---|
| 23 | fi
|
|---|
| 24 |
|
|---|
| 25 | if [ ! -e "$INSTDIR/keys/oscam.srvid" ]; then
|
|---|
| 26 | echo "use ipk config file: oscam.srvid"
|
|---|
| 27 | echo "rename $INSTDIR/keys/oscam.srvid.oscam > $INSTDIR/keys/oscam.srvid"
|
|---|
| 28 | mv "$INSTDIR/keys/oscam.srvid.oscam" "$INSTDIR/keys/oscam.srvid"
|
|---|
| 29 | else
|
|---|
| 30 | echo "found user config file: oscam.srvid"
|
|---|
| 31 | echo "skip ipk config file: oscam.srvid.oscam"
|
|---|
| 32 | fi
|
|---|
| 33 |
|
|---|
| 34 | if [ ! -e "$INSTDIR/keys/oscam.server" ]; then
|
|---|
| 35 | echo "use ipk config file: oscam.server"
|
|---|
| 36 | echo "rename $INSTDIR/keys/oscam.server.oscam > $INSTDIR/keys/oscam.server"
|
|---|
| 37 | mv "$INSTDIR/keys/oscam.server.oscam" "$INSTDIR/keys/oscam.server"
|
|---|
| 38 | else
|
|---|
| 39 | echo "found user config file: oscam.server"
|
|---|
| 40 | echo "skip ipk config file: oscam.server.oscam"
|
|---|
| 41 | fi
|
|---|
| 42 |
|
|---|
| 43 | if [ ! -e "$INSTDIR/keys/oscam.user" ]; then
|
|---|
| 44 | echo "use ipk config file: oscam.user"
|
|---|
| 45 | echo "rename $INSTDIR/keys/oscam.user.oscam > $INSTDIR/keys/oscam.user"
|
|---|
| 46 | mv "$INSTDIR/keys/oscam.user.oscam" "$INSTDIR/keys/oscam.user"
|
|---|
| 47 | else
|
|---|
| 48 | echo "found user config file: oscam.user"
|
|---|
| 49 | echo "skip ipk config file: oscam.user.oscam"
|
|---|
| 50 | fi
|
|---|
| 51 |
|
|---|
| 52 | if [ ! -e "$INSTDIR/keys/oscam.services" ]; then
|
|---|
| 53 | echo "use ipk config file: oscam.services"
|
|---|
| 54 | echo "rename $INSTDIR/keys/oscam.services.oscam > $INSTDIR/keys/oscam.services"
|
|---|
| 55 | mv "$INSTDIR/keys/oscam.services.oscam" "$INSTDIR/keys/oscam.services"
|
|---|
| 56 | else
|
|---|
| 57 | echo "found user config file: oscam.services"
|
|---|
| 58 | echo "skip ipk config file: oscam.services.oscam"
|
|---|
| 59 | fi
|
|---|
| 60 |
|
|---|
| 61 | if [ ! -e "$INSTDIR/keys/oscam.dvbapi" ]; then
|
|---|
| 62 | echo "use ipk config file: oscam.dvbapi"
|
|---|
| 63 | echo "rename $INSTDIR/keys/oscam.dvbapi.oscam > $INSTDIR/keys/oscam.dvbapi"
|
|---|
| 64 | mv "$INSTDIR/keys/oscam.dvbapi.oscam" "$INSTDIR/keys/oscam.dvbapi"
|
|---|
| 65 | else
|
|---|
| 66 | echo "found user config file: oscam.dvbapi"
|
|---|
| 67 | echo "skip ipk config file: oscam.dvbapi.oscam"
|
|---|
| 68 | fi
|
|---|
| 69 |
|
|---|
| 70 | if [ ! -e "$INSTDIR/keys/oscam.stat" ]; then
|
|---|
| 71 | echo "use ipk config file: oscam.stat"
|
|---|
| 72 | echo "rename $INSTDIR/keys/oscam.stat.oscam > $INSTDIR/keys/oscam.stat"
|
|---|
| 73 | mv "$INSTDIR/keys/oscam.stat.oscam" "$INSTDIR/keys/oscam.stat"
|
|---|
| 74 | else
|
|---|
| 75 | echo "found user config file: oscam.stat"
|
|---|
| 76 | echo "skip ipk config file: oscam.stat.oscam"
|
|---|
| 77 | fi
|
|---|
| 78 |
|
|---|
| 79 | echo "successfully installed"
|
|---|
| 80 | if [ "/var/swap" == "$INSTDIR" ]; then
|
|---|
| 81 | echo "syncing disk"
|
|---|
| 82 | sync
|
|---|
| 83 | else
|
|---|
| 84 | SPACE=`getfreespace "$INSTDIR"`
|
|---|
| 85 | FREE=`expr $SPACE - 100`
|
|---|
| 86 | echo new freespace size $FREE kb
|
|---|
| 87 | fi
|
|---|
| 88 | exit 0
|
|---|