-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpmPostInstall.script
executable file
·48 lines (30 loc) · 1.17 KB
/
pmPostInstall.script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
APPID=us.ryanhope.wterm
APPS=/media/cryptofs/apps
[ -d ${APPS} ] || { echo "Requires webOS 1.3.5 or later" ; exit 1 ; }
WEBOS_VER=`grep "PRODUCT_VERSION_STRING" /etc/palm-build-info | cut -f 3 -d " "`
MAJOR=`echo $WEBOS_VER | cut -f 1 -d "."`
MINOR=`echo $WEBOS_VER | cut -f 2 -d "."`
mount -o remount,rw /
APPDIR=${APPS}/usr/palm/applications/${APPID}
mv ${APPDIR}/fonts/* ${APPDIR}/
sed -i -e "/:${APPID}:/d" /var/palm/data/jailusers
JUID=5200
while [ `cat /var/palm/data/jailusers | cut -f 1 -d ':' | grep -c $JUID` -gt 0 ]; do
JUID=`expr $JUID + 1`
done
OLDSCHOOL=0
[ $MAJOR = 1 ] && OLDSCHOOL=1
[ $MAJOR = 2 -a $MINOR -lt 2 ] && OLDSCHOOL=1
rm -rf /etc/profile.d/*${APPID}*
mkdir -p /etc/profile.d
cp ${APPDIR}/50_${APPID} /etc/profile.d/
JAILCONF="${APPDIR}/jail.conf"
[ $OLDSCHOOL = 1 ] && JAILCONF="/etc/jail_native-palm.conf"
echo "${JUID}:5000:${APPID}:/dev/null:${JAILCONF}" >> /var/palm/data/jailusers
rm -f /var/palm/ls2/roles/pub/${APPID}.json
rm -f /var/palm/ls2/roles/prv/${APPID}.json
cp ${APPDIR}/roles/pub.json /var/palm/ls2/roles/pub/${APPID}.json
cp ${APPDIR}/roles/prv.json /var/palm/ls2/roles/prv/${APPID}.json
ls-control scan-services
exit 0