1 | #!/bin/sh |
---|
2 | |
---|
3 | #replace by symlink |
---|
4 | if ! [ -L /etc/cups ]; then |
---|
5 | mv /etc/cups /etc/cups.old |
---|
6 | ln -s /home/system/cups /etc/cups 2>/dev/null |
---|
7 | fi |
---|
8 | |
---|
9 | if ! [ -L /etc/samba ]; then |
---|
10 | ln -s /home/system/samba /etc/samba 2>/dev/null |
---|
11 | fi |
---|
12 | |
---|
13 | |
---|
14 | # Check of de smb.conf bestaat. |
---|
15 | if [ ! -f /home/system/samba/smb.conf ]; then |
---|
16 | mv /home/system/samba/smb.conf-sample /home/system/samba/smb.conf |
---|
17 | fi |
---|
18 | if [ ! -f /home/shares/netlogon/logon.bat ]; then |
---|
19 | mv /home/shares/netlogon/logon.bat.new /home/shares/netlogon/logon.bat |
---|
20 | fi |
---|
21 | |
---|
22 | if ! cat /home/system/samba/smb.conf | grep "store dos attributes" &> /dev/null; then |
---|
23 | sed -i /home/system/samba/smb.conf \ |
---|
24 | -e "s/ unix extensions = no/ unix extensions = no\n store dos attributes = yes/" |
---|
25 | fi |
---|
26 | |
---|
27 | if ! cat /home/system/samba/smb.conf | grep "recycle:repository" &> /dev/null; then |
---|
28 | sed -i /home/system/samba/smb.conf \ |
---|
29 | -e "s/ store dos attributes = yes/ store dos attributes = yes\n recycle:keeptree = yes\n recycle:touch = yes\n recycle:versions = yes\n recycle:repository = .\/trash/" |
---|
30 | sed -i /home/system/samba/smb.conf \ |
---|
31 | -e "s/ store dos attributes = no/ store dos attributes = no\n recycle:keeptree = yes\n recycle:touch = yes\n recycle:versions = yes\n recycle:repository = .\/trash/" |
---|
32 | fi |
---|
33 | |
---|
34 | if ! cat /home/system/samba/smb.conf | grep "recycle:directory_mode" &> /dev/null; then |
---|
35 | sed -i /home/system/samba/smb.conf \ |
---|
36 | -e "s/ recycle:repository = .\/trash/ recycle:repository = .\/trash\n recycle:directory_mode = 0777/" |
---|
37 | fi |
---|
38 | |
---|
39 | sed -i /home/system/samba/smb.conf -e "s@\./trash@trash@" |
---|
40 | |
---|
41 | |
---|
42 | #add new setting (v3.4) |
---|
43 | if ! grep "map untrusted to domain" /home/system/samba/smb.conf; then |
---|
44 | sed -i /home/system/samba/smb.conf -e 's/^.global./[global]\nmap untrusted to domain = yes/' |
---|
45 | fi |
---|
46 | |
---|
47 | #add new setting (v3.5) |
---|
48 | if ! grep "max protocol" /home/system/samba/smb.conf; then |
---|
49 | sed -i /home/system/samba/smb.conf -e 's/^.global./[global]\nmax protocol = SMB2/' |
---|
50 | fi |
---|
51 | |
---|
52 | #change setting settings (v4.4.4) |
---|
53 | # https://wiki.samba.org/index.php/Required_settings_for_NT4-style_domains |
---|
54 | sed -i /home/system/samba/smb.conf -e 's/max protocol = SMB2/max protocol = NT1/' |
---|
55 | |
---|
56 | |
---|
57 | #let kernel do auto performance tuning. (the old value of 8k is bad!) |
---|
58 | sed -i /home/system/samba/smb.conf -e 's/.*socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192.*//' |
---|
59 | |
---|
60 | chmod 1777 /home/shares/profiles |
---|
61 | chmod 1777 /home/shares/spool |
---|
62 | |
---|
63 | #private is in another place in the official slackware version: |
---|
64 | mv /home/system/samba/private/* /var/lib/samba/private/ 2>/dev/null |
---|
65 | rmdir /home/system/samba/private 2>/dev/null |
---|
66 | |
---|
67 | #nodig vanaf 4.4.4 (windows 10?) |
---|
68 | chmod +x /home/shares/netlogon/logon.bat |
---|
69 | |
---|
70 | exit 0 |
---|