forked from dncodes/mpower-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-nocontroller.sh
35 lines (27 loc) · 1.02 KB
/
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
#!/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
wget --no-check-certificate -q https://raw.githubusercontent.com/magcode/mpower-tools/master/nocontroller/start.sh -O $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"
echo -e "$startscript" >> $poststart
fi
echo "Done!"
echo "run 'save' command if done."