forked from dnlongen/ASUSWRT_Samba_Fixer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fixsamba
27 lines (23 loc) · 555 Bytes
/
fixsamba
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
#!/bin/sh
touch /tmp/000init-start
# Wait for all services to load
i=0
while [ $i -le 20 ]; do
success_start_service=`nvram get success_start_service`
if [ "$success_start_service" == "1" ]; then
break
fi
i=$(($i+1))
echo "autorun APP: wait $i seconds...";
sleep 1
done
# Kill Samba service, replace conf file with custom, and restart
for pid in `ps -w | grep smbd | grep -v grep | awk '{print $1}'`
do
echo "killing $pid"
kill $pid
done
sleep 3m
cp /jffs/smb.conf /etc/
chmod 444 /etc/smb.conf
smbd -D -s /etc/smb.conf