source: npl/fileserver/samba_conf/root/etc/postinst.d/post.samba

Last change on this file was 0be8a71, checked in by Edwin Eefting <edwin@datux.nl>, 7 years ago

windows 10 doesnt support PDC anymore

  • Property mode set to 100755
File size: 2.8 KB
RevLine 
[c5c522c]1#!/bin/sh
2
[6f166c4]3#replace by symlink
4if ! [ -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
7fi
8
9if ! [ -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
12fi
[c5c522c]13
14
15# Check of de smb.conf bestaat.
16if [ ! -f /home/system/samba/smb.conf ]; then
17        mv /home/system/samba/smb.conf-sample /home/system/samba/smb.conf
18fi
19if [ ! -f /home/shares/netlogon/logon.bat ]; then
20        mv /home/shares/netlogon/logon.bat.new /home/shares/netlogon/logon.bat
21fi
22
[1f5b330]23if ! 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/"
26fi
27
28if ! 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/"
33fi
34
35if ! 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/"
38fi
39
40sed -i /home/system/samba/smb.conf -e "s@\./trash@trash@"
41
42
43#add new setting (v3.4)
44if ! 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/'
46fi
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!)
59sed -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]62sed -i  /home/system/samba/smb.conf -e 's/.*max protocol.*//g'
[0be8a71]63
[c5c522c]64chmod 1777 /home/shares/profiles
65chmod 1777 /home/shares/spool
66
67#private is in another place in the official slackware version:
68mv /home/system/samba/private/* /var/lib/samba/private/ 2>/dev/null
69rmdir /home/system/samba/private 2>/dev/null
70
71#nodig vanaf 4.4.4 (windows 10?)
72chmod +x /home/shares/netlogon/logon.bat
73
74exit 0
Note: See TracBrowser for help on using the repository browser.