forked from steve8x8/filehub-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
51start_all.sh_OFF
111 lines (104 loc) · 3.76 KB
/
51start_all.sh_OFF
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Prevent sdcard from being used for swap location
# Was fixed in swap.sh but now we're stopping swap.sh being called for sd cards
# busybox 1.12 (WD01 with firmware 2.000.030) does have diff (though not linked in /bin/),
# it doesn't have patch. Either use the following with a bootstrapped busybox, or have
# EnterRouterMode.sh replace the file. YMMV...
# I disabled swap here and by setting the firmware variable. If you have trouble with slow
# rsync. Then check the swap files, automatic remounting left a non existing swap at
# "/.vst/swapfile" which couldn't be removed (other than by reboot). Better idea was to
# set the swap file just before starting rsync and then turn it off again after.
# /etc/init.d/start_all.sh.patch
#--- /etc/init.d/start_all.sh Sun Feb 7 21:30:58 2016
#+++ /data/UsbDisk1/Volume1/start_all.sh Sun Feb 7 21:29:51 2016
# fi
#+# Swap file started from backup script, remounting disks didn't play nice
# echo "swapon"
#+# Prevent sdcard from being used for swap
# while read device mountpoint fstype remainder; do
#- str_func_strstr "$mountpoint" "UsbDisk"
#- if [ $? -eq 1 ];then
#+# udisk=$(str_func_strstr "$mountpoint" "UsbDisk")
#+# sdcard=$(str_func_strstr "$mountpoint" "UsbDisk1")
#+# if [ $udisk -eq 1 -a $sdcard -eq 0 ];then
#- echo "mountpoint:$mountpoint" >> /tmp/usb_add_info
#+# echo "mountpoint:$mountpoint" >> /tmp/usb_add_info
#- echo /etc/init.d/swap $mountpoint >> /tmp/usb_add_info
#+# echo /etc/init.d/swap $mountpoint >> /tmp/usb_add_info
#- echo 1 > /proc/sys/vm/drop_caches
#+# echo 1 > /proc/sys/vm/drop_caches
#- /etc/init.d/swap $mountpoint
#+# /etc/init.d/swap $mountpoint
#- break
#+# break
#- fi
#+# fi
#-done < /proc/mounts
#+#done < /proc/mounts
#echo "start udev"
#/etc/init.d/udev
# replace start_all.sh (only needed once)
cat <<'EOF' > /etc/init.d/start_all.sh
#!/bin/sh
. /etc/init.d/vstfunc
#swapon
# mount.exfat-fuse -o rw,umask=000,noatime,nonempty,asy
echo "remount"
if [ ! -f lib/modules/2.6.21/kernel/drivers/tuxera/texfat.ko ]; then
while read device mountpoint fstype remainder; do
if [ "$fstype" == "fuseblk" ];then
/usr/sbin/umount2 $mountpoint
mount.exfat-fuse -o rw,umask=000,noatime,nonempty,async,iocharset=utf8 $device $mountpoint
fi
done < /proc/mounts
fi
# Swap file started from backup script, remounting disks didn't play nice
#echo "swapon"
# Prevent sdcard from being used for swap
#while read device mountpoint fstype remainder; do
# udisk=$(str_func_strstr "$mountpoint" "UsbDisk")
# sdcard=$(str_func_strstr "$mountpoint" "UsbDisk1")
# if [ $udisk -eq 1 -a $sdcard -eq 0 ];then
# echo "mountpoint:$mountpoint" >> /tmp/usb_add_info
# echo /etc/init.d/swap $mountpoint >> /tmp/usb_add_info
# echo 1 > /proc/sys/vm/drop_caches
# /etc/init.d/swap $mountpoint
# break
# fi
#done < /proc/mounts
#start udev
#echo "start udev"
#/etc/init.d/udev
echo "start service"
ifconfig ra0 down
netinit.sh
/usr/sbin/led_control
#/usr/sbin/udhcpd /etc/udhcpd.conf
#netmod=`nvram_get OperationMode`
#if [ $netmod -eq 1 ]; then
# udhcpc -i eth2.2 -s /sbin/udhcpc.sh -p /var/run/udhcp &
#else
# udhcpc -i apcli0 -s /sbin/udhcpc.sh -p /var/run/udhcp &
#fi
#/usr/sbin/upnpd &
#/usr/sbin/led_control
# Run the START scripts.
for i in /etc/rc.d/rc1.d/S* ; do
# Check if the subsystem is already up.
subsys=${i#/etc/rc.d/rc1.d/S??}
str_func_strstr "$i" "S32smbd"
if [ $? -eq 1 ]; then
echo "smb not start"
else
echo $i restart
$i restart
fi
done
/etc/rc.d/rc1.d/S32smbd restart
telnetd &
/usr/sbin/au &
if [ -f /usr/sbin/usbdongled ]; then
usbdongled &
fi
EOF
# Make executable
chmod +x /etc/init.d/start_all.sh