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