#!/bin/sh #replace by symlink if ! [ -L /etc/cups ]; then mv /etc/cups /etc/cups.old 2>/dev/null ln -s /home/system/cups /etc/cups 2>/dev/null fi if ! [ -L /etc/samba ]; then mv /etc/samba /etc/samba.old 2>/dev/null ln -s /home/system/samba /etc/samba 2>/dev/null fi # Check of de smb.conf bestaat. if [ ! -f /home/system/samba/smb.conf ]; then mv /home/system/samba/smb.conf-sample /home/system/samba/smb.conf fi if [ ! -f /home/shares/netlogon/logon.bat ]; then mv /home/shares/netlogon/logon.bat.new /home/shares/netlogon/logon.bat fi if ! cat /home/system/samba/smb.conf | grep "store dos attributes" &> /dev/null; then sed -i /home/system/samba/smb.conf \ -e "s/ unix extensions = no/ unix extensions = no\n store dos attributes = yes/" fi if ! cat /home/system/samba/smb.conf | grep "recycle:repository" &> /dev/null; then sed -i /home/system/samba/smb.conf \ -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/" sed -i /home/system/samba/smb.conf \ -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/" fi if ! cat /home/system/samba/smb.conf | grep "recycle:directory_mode" &> /dev/null; then sed -i /home/system/samba/smb.conf \ -e "s/ recycle:repository = .\/trash/ recycle:repository = .\/trash\n recycle:directory_mode = 0777/" fi sed -i /home/system/samba/smb.conf -e "s@\./trash@trash@" #add new setting (v3.4) if ! grep "map untrusted to domain" /home/system/samba/smb.conf; then sed -i /home/system/samba/smb.conf -e 's/^.global./[global]\nmap untrusted to domain = yes/' fi #add new setting (v3.5) #if ! grep "max protocol" /home/system/samba/smb.conf; then # sed -i /home/system/samba/smb.conf -e 's/^.global./[global]\nmax protocol = SMB2/' #fi #change setting settings (v4.4.4) # https://wiki.samba.org/index.php/Required_settings_for_NT4-style_domains #sed -i /home/system/samba/smb.conf -e 's/max protocol = SMB2/max protocol = NT1/' #let kernel do auto performance tuning. (the old value of 8k is bad!) sed -i /home/system/samba/smb.conf -e 's/.*socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192.*//' #samba 4.7+ chooses good defaults. Windows 10 doesnt support SMBv1 anymore since 10 april 2018. sed -i /home/system/samba/smb.conf -e 's/.*max protocol.*//g' chmod 1777 /home/shares/profiles chmod 1777 /home/shares/spool #private is in another place in the official slackware version: mv /home/system/samba/private/* /var/lib/samba/private/ 2>/dev/null rmdir /home/system/samba/private 2>/dev/null #nodig vanaf 4.4.4 (windows 10?) chmod +x /home/shares/netlogon/logon.bat exit 0