EOF
}
-for x in /a/c/repos/bash/!(.git); do
+for x in /a/c/repos/bash/!(.git|..|.); do
lnf-home "$x"
sudo -i <<EOF
PATH="/a/exe:$PATH"
/i/k /k none bind 0 0
EOF
-if ! mountpoint /kfrodo; then
- s mkdir -p /kfrodo
- s chown ian:traci /kfrodo
+if ! mountpoint /kr; then
+ s mkdir -p /kr
+ s chown ian:traci /kr
fi
-if [[ $HOSTNAME == frodo ]]; then
+if [[ $HOSTNAME == treetowl ]]; then
tu /etc/fstab <<'EOF'
-/k /kfrodo none bind 0 0
+/k /kr none bind 0 0
EOF
else
tu /etc/fstab <<'EOF'
-frodo:/k /kfrodo nfs defaults 0 0
+treetowl:/k /kr nfs defaults 0 0
EOF
fi
# using debconf-set-selection, the area gets reset to ETC
# on my linode test machine after doing a dpkg-reconfigure, or a reinstall,
# so we are using expect :(
-apt-get install --no-install-recommends expect
+s apt-get -y install --no-install-recommends expect
s expect <<EOF
set force_conservative 0
spawn dpkg-reconfigure tzdata -freadline
####### misc packages ###########
-if [[ $HOSTNAME == frodo ]]; then
+if [[ $HOSTNAME == treetowl ]]; then
case $distro in
debian|ubuntu)
# note i had to do this, which is persistent:
"profiles" : [
{
"profile-name" : "Default",
- "hostname" : "frodo",
+ "hostname" : "treetowl",
"rpc-url-path" : "/transmission/rpc",
"username" : "",
"password" : "",
EOF
# had this fail with 'Failed to connect to bus: No such file or directory'
# then when I tried it manually, it worked fine...
- systemctl --user daemon-reload
+ if ! systemctl --user daemon-reload; then
+ sleep 2
+ echo retrying systemd user daemon reload
+ systemctl --user daemon-reload
+ fi
;;&
*)
# taken from arch wiki.
EOF
-if [[ $HOSTNAME == frodo ]] && ! sudo test -e /etc/openvpn/client.key; then
+if [[ $HOSTNAME == treetowl ]] && ! sudo test -e /etc/openvpn/client.key; then
/a/bin/vpn-setup/vpn-mk-client-cert dopub
fi
;;
esac
-if [[ $HOSTNAME == frodo ]]; then
- tu /etc/exports <<'EOF'
-/k 192.168.1.0/24(rw,nohide,no_subtree_check,insecure)
-EOF
- s exportfs -rav
-fi
-
-if [[ -e /k/video ]]; then
+if [[ $HOSTNAME == treetowl ]]; then
# nohide = export filesystems mounted deeper than the export point
# fsid=0 makes this export the "root" export
# not documented in the man page, but this means
# 1. it can be mounted with a shorthand of server:/
# 2. exports that are subdirectories of this one will automatically be mounted
- tu /etc/exports '/i/video 192.168.1.0/24(rw,fsid=0,nohide,no_root_squash,async,no_subtree_check,insecure)'
+ tu /etc/exports <<'EOF'
+/k 192.168.1.0/24(rw,fsid=0,nohide,no_root_squash,async,no_subtree_check,insecure)
+EOF
s exportfs -rav
- showmount -e localhost
fi
-
e "$end_msg_var"
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)"