3 # this is from distro-end
5 if [[ $HOSTNAME == kd
]]; then
7 # note samba re-reads it\'s config every 1 minute
9 arch
) s
cp /etc
/samba
/smb.conf.default
/etc
/samba
/smb.conf
;;
12 # add 2 lines after workgroup option
13 s
sed -ri --follow-symlinks '/^\s*encrypt passwords\s*=/d' /etc
/samba
/smb.conf
14 s
sed -ri --follow-symlinks '/^\s*map to guest\s*=/d' /etc
/samba
/smb.conf
15 s
sed -i --follow-symlinks 's/\(\s*workgroup\s*=\).*/\1 WORKGROUP\n\tencrypt passwords = yes\n\tmap to guest = bad password/' /etc
/samba
/smb.conf
16 # remove default homes section. not sharing that.
17 s
sed -ri --follow-symlinks '/^\s*\[homes\]/,/\s*\[/d' /etc
/samba
/smb.conf
19 if ! grep -xF '[public]' /etc
/samba
/smb.conf
&>/dev
/null
; then
20 s
tee -a /etc
/samba
/smb.conf
<<'EOF'
29 debian|trisquel|ubuntu
)
30 # systemd claims it generates units from /etc/init.d, but it
31 # clearly doesn\'t in debian. I have no idea how they are
32 # related. fuck debian right now. It\'s not documented. samba
33 # has a systemd init file linked to /dev/null. There\'s this
34 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769714 which
35 # claims samba\'s sub-services will be started automatically by
36 # systemd... it didn\'t on install, wonder if it will on
37 # boot. It clued me in how to start it manually though. Nothing
38 # in /usr/share/doc/samba, debian admin guide says nothing about
39 # any of this. (this is in debian testing as of 4/2016).
41 s
/etc
/init.d
/samba start