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

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

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