#!/bin/bash -l
# Copyright (C) 2016 Ian Kelling
# This program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>
-set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+errcatch
set -x
pup
simple_packages=(
+ htop
mailutils
nmon
ruby
vim
)
-if [[ $HOSTNAME != lj && $HOSTNAME != lk ]]; then
- # universal packages
- simple_packages+=(
- apache2
- bwm-ng
- chromium
- duplicity
- evince
- fdupes
- filelight
- gdb
- gnome-screenshot
- jq
- locate
- meld
- offlineimap
- p7zip
- paprefs
- pavucontrol
- pdfgrep
- pianobar
- pidgin
- rdiff-backup
- slock
- squashfs-tools
- tcpdump
- transmission-remote-gtk
- vlc
- )
-fi
+case $HOSTNAME in
+ lj|li) : ;;
+ *)
+ # universal packages
+ # swh-plugins is for karaoke pulsaudio filter.
+ simple_packages+=(
+ apache2
+ bwm-ng
+ chromium
+ duplicity
+ evince
+ fdupes
+ filelight
+ gdb
+ gnome-screenshot
+ jq
+ locate
+ meld
+ offlineimap
+ p7zip
+ paprefs
+ pavucontrol
+ pdfgrep
+ pianobar
+ pidgin
+ rdiff-backup
+ slock
+ squashfs-tools
+ swh-plugins
+ tcpdump
+ transmission-remote-gtk
+ vlc
+ )
+ ;;
+esac
case $HOSTNAME in
- lj|lk)
+ lj|li)
pi "${simple_packages[@]}"
- $src/homepage-setup
- $src/
-
-# start=' *<source lang="bash"> *'
-# end=' *<\/source> *'
-# ruby <<'EOF' | sed -rn "/^$start$/,/^$end$/{s/^$start|$end$/# \0/;p}" | bash
-# require 'json'
-# puts JSON.parse(`curl 'https://ofswiki.org/w/api.php?\
-# action=query&titles=Mediawiki_Setup_Guide&prop=revisions&rvprop=content&\
-# format=json'`.chomp)['query']['pages'].values[0]['revisions'][0]['*']
-# EOF
-# nginx-site iankelling.org
+ case $HOSTNAME in
+ lj) domain=iank.bid ;;
+ li) domain=iankelling.org ;;
+ esac
+ homepage-setup $domain
+ s rld /a/h/_site/ /var/www/$domain/html
+
+ curl https://$domain/git/?p=mediawiki-setup/.git;a=blob_plain;f=mw-setup-script;hb=HEAD | bash
+ $src/phab-setup
+
echo "$0: $(date): ending now)"
exit 0
;;
esac
-########### end section including lj ###############
+########### end section including li/lj ###############
case $distro in
esac
fi
+# dunno why it's there, but get rid of it
+case $HOSTNAME in
+ li|lj) s rm -rf /home/linode ;;
+esac
+
# arch had a default config,
# debian had nothing until you start it.
# With a little trial an error, here is a minimal config
# only settings I set were
# hostname
# auto-connect
-#
for f in /home/*; do
d=$f/.config/transmission-remote-gtk
u=${f##*/}
ser disable openvpn@client
ser disable openvpn
;;
- *) pi openvpn ;;
+ # suggests because we want the resolvconf package
+ *) pi --install-suggests openvpn;;
esac
pi wget
debian|ubuntu)
log=$(mktemp)
cd /a/opt
- wget -N https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- set +e
- s dpkg -i google-chrome-stable_current_amd64.deb &> $log
+ wget -nv -N https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
+ errallow
+ s dpkg -i google-chrome-stable_current_amd64.deb |& tee $log
code=$?
- set -e
+ errcatch
case $code in
- 1)
+ 0) : ;;
+ *)
if grep '^dpkg: dependency problems prevent configuration of' \
$log &>/dev/null; then
s apt-get -fy install
exit 1
fi
;;
- 0) : ;;
- *) exit $code
esac
;;
arch)
# deal with mismatching unison compilers, but I dont
# see any reason to revert it, since it only installs
# a single package which is primarily a single binary
- pi unison-gtk/testing unison/testing
- ;;
- testing)
- piunison unison-gtk
;;
esac
+ pi unison/testing
+ pi unison-gtk/testing # after to make it the default unison
;;
arch)
pi unison gtk2