blob: de196ffd4c9362dc4ef0e177e0ff85f0e2b2e971 [file] [log] [blame]
Zvikomborero VIncent Zvikarambacef4b702016-07-26 06:06:49 -04001#!/system/xbin/bash
2
3MODE=$1
4
5RS_PATH=/system/rilswitch/
6
7ROPT_PATH=bin/radiooptions
8RILD_PATH=bin/rild
9REF_RIL_PATH=lib/libreference-ril.so
10LIBRIL_PATH=lib/libril.so
11LIBRILUTIL_PATH=lib/librilutils.so
Zvikomborero VIncent Zvikarambacef4b702016-07-26 06:06:49 -040012
13#remount the system
14mount -o remount,rw /system
15
Zvikomborero VIncent Zvikarambacef4b702016-07-26 06:06:49 -040016if [ -n $MODE ]; then
17 #kill rild
18 kill `pidof rild`
19 mv /system/$RILD_PATH /system/$RILD_PATH.old
Zvikomborero VIncent Zvikarambab8949842016-07-26 06:54:34 -040020 cp $RS_PATH/$MODE/$ROPT_PATH /system/$ROPT_PATH 2>/dev/null
Zvikomborero VIncent Zvikarambacef4b702016-07-26 06:06:49 -040021 cp $RS_PATH/$MODE/$RILD_PATH /system/$RILD_PATH
22 cp $RS_PATH/$MODE/$REF_RIL_PATH /system/$REF_RIL_PATH
23 cp $RS_PATH/$MODE/$LIBRIL_PATH /system/$LIBRIL_PATH
24 cp $RS_PATH/$MODE/$LIBRILUTIL_PATH /system/$LIBRILUTIL_PATH
Zvikomborero VIncent Zvikarambacef4b702016-07-26 06:06:49 -040025 rm /system/$RILD_PATH.old
26 #check if we copied successfully
27 if [ $? != 0 ]; then
28 #kill rild again for good measure
29 kill `pidof rild`
30 #copy again
31 mv /system/$RILD_PATH /system/$RILD_PATH.old
32 cp $RS_PATH/$MODE/$RILD_PATH /system/$RILD_PATH
33 rm /system/$RILD_PATH.old
34 fi
35fi
36
37#set permissions
38chmod 0655 /system/$RILD_PATH
39chmod 0655 /system/$ROPT_PATH
40chmod 0644 /system/$REF_RIL_PATH
41chmod 0644 /system/$LIBRIL_PATH
42chmod 0644 /system/$LIBRILUTIL_PATH
43chmod 0644 /system/$SECRIL_C_PATH
44
45#remount the system
46mount -o remount,ro /system
47
48
49
50
51
52
53