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

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

fix symlink issue in sambaconfig after upgrading. updated samba to 4.4.14

  • Property mode set to 100755
File size: 2.5 KB
Line 
1#!/bin/sh
2
3#replace by symlink
4if ! [ -L /etc/cups ]; then
5        mv /etc/cups /etc/cups.old
6        ln -s /home/system/cups /etc/cups 2>/dev/null
7fi
8
9if ! [ -L /etc/samba ]; then
10        ln -s /home/system/samba /etc/samba 2>/dev/null
11fi
12
13
14# Check of de smb.conf bestaat.
15if [ ! -f /home/system/samba/smb.conf ]; then
16        mv /home/system/samba/smb.conf-sample /home/system/samba/smb.conf
17fi
18if [ ! -f /home/shares/netlogon/logon.bat ]; then
19        mv /home/shares/netlogon/logon.bat.new /home/shares/netlogon/logon.bat
20fi
21
22if ! 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/"
25fi
26
27if ! 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/"
32fi
33
34if ! 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/"
37fi
38
39sed -i /home/system/samba/smb.conf -e "s@\./trash@trash@"
40
41
42#add new setting (v3.4)
43if ! 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/'
45fi
46
47#add new setting (v3.5)
48if ! grep "max protocol" /home/system/samba/smb.conf; then
49        sed -i /home/system/samba/smb.conf -e 's/^.global./[global]\nmax protocol = SMB2/'
50fi
51
52#change setting settings (v4.4.4)
53# https://wiki.samba.org/index.php/Required_settings_for_NT4-style_domains
54sed -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!)
58sed -i /home/system/samba/smb.conf -e 's/.*socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192.*//'
59
60chmod 1777 /home/shares/profiles
61chmod 1777 /home/shares/spool
62
63#private is in another place in the official slackware version:
64mv /home/system/samba/private/* /var/lib/samba/private/ 2>/dev/null
65rmdir /home/system/samba/private 2>/dev/null
66
67#nodig vanaf 4.4.4 (windows 10?)
68chmod +x /home/shares/netlogon/logon.bat
69
70exit 0
Note: See TracBrowser for help on using the repository browser.