-
Notifications
You must be signed in to change notification settings - Fork 0
/
postinst
executable file
·51 lines (36 loc) · 1.43 KB
/
postinst
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
49
50
51
#!/bin/sh
APPID=org.webosinternals.sudoh
CSRVID=org.webosinternals.sudoh
APPS=/media/cryptofs/apps
[ -d ${APPS} ] || { echo "Requires webOS 1.3.5 or later" ; exit 1 ; }
APPDIR=${APPS}/usr/palm/applications/${APPID}
CSRVDIR=${APPS}/usr/palm/applications/${APPID}/src
# Remove the C service executable
rm -f /var/usr/sbin/${CSRVID}
# Remove the dbus service
rm -f /var/palm/system-services/${CSRVID}.service
# Remove the ls2 roles
rm -f /var/palm/ls2/roles/prv/${CSRVID}.json /var/palm/ls2/roles/pub/${CSRVID}.json
# Stop the C service if running
/sbin/stop ${CSRVID} || true
/usr/bin/killall -9 ${CSRVID} || true
# Remove the upstart script
rm -f /var/palm/event.d/${CSRVID}
# Install the C service executable
mkdir -p /var/usr/sbin/
install -m 755 ${CSRVDIR}/sudoh /var/usr/sbin/${CSRVID}
# Install the dbus service
mkdir -p /var/palm/ls2/services/prv /var/palm/ls2/services/pub
cp ${CSRVDIR}/${CSRVID}.service /var/palm/ls2/services/prv/${CSRVID}.service
cp ${CSRVDIR}/${CSRVID}.service /var/palm/ls2/services/pub/${CSRVID}.service
# Install the ls2 roles
mkdir -p /var/palm/ls2/roles/prv /var/palm/ls2/roles/pub
cp ${CSRVDIR}/${CSRVID}.json /var/palm/ls2/roles/prv/${CSRVID}.json
cp ${CSRVDIR}/${CSRVID}.json /var/palm/ls2/roles/pub/${CSRVID}.json
/usr/bin/ls-control scan-services || true
# Install the upstart script
mkdir -p /var/palm/event.d
cp ${CSRVDIR}/${CSRVID} /var/palm/event.d/${CSRVID}
# Start the C service
/sbin/start ${CSRVID}
exit 0