-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathinstall-nocontroller.sh
36 lines (28 loc) · 1022 Bytes
/
install-nocontroller.sh
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
#!/bin/sh
#
echo "Installing nocontroller ..."
scriptdir=/var/etc/persistent/nocontroller
mkdir -p $scriptdir
# in case already installed, we need to unmount first
umount /usr/etc/syswrapper.sh
sed 's/pkill -9 mcad/exit 0\n pkill -9 mcad/;s/pkill -9 wpa_supplicant/exit 0\n pkill -9 wpa_supplicant/' /usr/etc/syswrapper.sh > $scriptdir/syswrapper.sh
chmod 755 $scriptdir/syswrapper.sh
startscript=$scriptdir/start.sh
poststart=/etc/persistent/rc.poststart
mv ~/start.sh $startscript
chmod 755 $startscript
if [ ! -f $poststart ]; then
echo "$poststart not found, creating it ..."
touch $poststart
echo "#!/bin/sh" >> $poststart
chmod 755 $poststart
fi
if grep -q "$startscript" "$poststart"; then
echo "Found $poststart entry. File will not be changed"
else
echo "Adding start command to $poststart as first line"
awk "NR==1{print; print \"$startscript\"} NR!=1" $poststart > /tmp/poststart
mv /tmp/poststart $poststart
fi
echo "Done!"
echo "run 'save' command if done."