From: Ian Kelling Date: Wed, 28 Sep 2016 01:12:33 +0000 (-0700) Subject: change fileserver host X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=commitdiff_plain;h=ed54781df7f0b6259c3b5d2cdc953f281b90b398 change fileserver host --- diff --git a/distro-begin b/distro-begin index 1c15acf..f61b2f1 100755 --- a/distro-begin +++ b/distro-begin @@ -213,7 +213,7 @@ lnf ${opts[@]} "$1" /home/traci/$2 EOF } -for x in /a/c/repos/bash/!(.git); do +for x in /a/c/repos/bash/!(.git|..|.); do lnf-home "$x" sudo -i </dev/null; then fi -pi samba -# note samba re-reads it's config every 1 minute -case $distro in - arch) s cp /etc/samba/smb.conf.default /etc/samba/smb.conf ;; -esac +if [[ $HOSTNAME == treetowl ]]; then + pi samba + # note samba re-reads it\'s config every 1 minute + case $distro in + arch) s cp /etc/samba/smb.conf.default /etc/samba/smb.conf ;; + esac -# add 2 lines after workgroup option -s sed -ri --follow-symlinks '/^\s*encrypt passwords\s*=/d' /etc/samba/smb.conf -s sed -ri --follow-symlinks '/^\s*map to guest\s*=/d' /etc/samba/smb.conf -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 -# remove default homes section. not sharing that. -s sed -ri --follow-symlinks '/^\s*\[homes\]/,/\s*\[/d' /etc/samba/smb.conf + # add 2 lines after workgroup option + s sed -ri --follow-symlinks '/^\s*encrypt passwords\s*=/d' /etc/samba/smb.conf + s sed -ri --follow-symlinks '/^\s*map to guest\s*=/d' /etc/samba/smb.conf + 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 + # remove default homes section. not sharing that. + s sed -ri --follow-symlinks '/^\s*\[homes\]/,/\s*\[/d' /etc/samba/smb.conf -if ! grep -xF '[public]' /etc/samba/smb.conf &>/dev/null; then - s tee -a /etc/samba/smb.conf <<'EOF' + if ! grep -xF '[public]' /etc/samba/smb.conf &>/dev/null; then + s tee -a /etc/samba/smb.conf <<'EOF' [public] guest ok = yes read only = no - path = /kfrodo + path = /kr EOF -fi + fi -case $distro in - debian|ubuntu) - # systemd claims it generates units from /etc/init.d, but it - # clearly doesn\'t in debian. I have no idea how they are - # related. fuck debian right now. It\'s not documented. samba - # has a systemd init file linked to /dev/null. There\'s this - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769714 which - # claims samba\'s sub-services will be started automatically by - # systemd... it didn\'t on install, wonder if it will on - # boot. It clued me in how to start it manually though. Nothing - # in /usr/share/doc/samba, debian admin guide says nothing about - # any of this. (this is in debian testing as of 4/2016). - - s /etc/init.d/samba start - ;; - arch) - sgo samba - ;; -esac + case $distro in + debian|ubuntu) + # systemd claims it generates units from /etc/init.d, but it + # clearly doesn\'t in debian. I have no idea how they are + # related. fuck debian right now. It\'s not documented. samba + # has a systemd init file linked to /dev/null. There\'s this + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769714 which + # claims samba\'s sub-services will be started automatically by + # systemd... it didn\'t on install, wonder if it will on + # boot. It clued me in how to start it manually though. Nothing + # in /usr/share/doc/samba, debian admin guide says nothing about + # any of this. (this is in debian testing as of 4/2016). + + s /etc/init.d/samba start + ;; + arch) + sgo samba + ;; + esac +fi tu /etc/hosts <<< "127.0.1.1 $(hostname).lan $(hostname)"