#!/bin/bash
# Copyright (C) 2019 Ian Kelling
# SPDX-License-Identifier: AGPL-3.0-or-later
-if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi
+export BRC=t; if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi
### setup
source /a/bin/errhandle/err
exit 1
fi
-errcatch-cleanup() {
+err-cleanup() {
echo 1 >~/.local/distro-end
}
# shellcheck source=./pkgs
source $src/pkgs
-exec &> >(sudo tee -a /var/log/distro-end)
-echo "$0: $(date): starting now)"
+echo "$0: $(date) starting now)"
# see example of usage to understand.
end_msg() {
local y
echo 0 >~/.local/distro-end
if $pending_reboot; then
echo "$0: pending reboot and then finished. doing it now."
+ echo "exiting with status 0"
sudo reboot now
else
echo "$0: $(date): ending now)"
+ echo "exiting with status 0"
fi
exit 0
}
### begin certbot install ###
-if [[ $distro == debian ]]; then
+if [[ $distro == debian || $codename_compat == bionic ]]; then
# note, need python-certbot-nginx for nginx, but it depends on nginx,
# and I'm not installing nginx by default right now.
- pi certbot python-certbot-apache
+ pi certbot python3-certbot-apache
elif [[ $codename_compat == xenial ]]; then
# not packaged in xenial or flidas
pi software-properties-common
Package: *
Pin: release a=xenial-security
Pin-Priority: -100
+
+Package: firefox
+Pin: release n=xenial
+Pin-Priority: 500
EOF
sd /etc/apt/sources.list.d/xenial.list 2>/dev/null <<EOF
deb http://us.archive.ubuntu.com/ubuntu/ xenial main
EOF
- ;;
+ ;;&
+ etiona)
+ sd /etc/apt/preferences.d/etiona-bionic <<'EOF'
+Package: *
+Pin: release n=bionic
+Pin-Priority: -100
+
+Package: firefox gnome-screenshot gnome-icon-theme libnautilus-extension1a gnome-settings-daemon nautilus yelp gnome-settings-daemon-schemas nautilus-data ubuntu-wallpapers gnome-control-center gnome-control-center-data gnome-control-center-faces libsnapd-glib1 ubuntu-wallpapers-bionic gir1.2-snapd-1 ubuntu-drivers-common ubuntu-docs libyelp0
+Pin: release n=bionic
+Pin-Priority: 500
+EOF
+ ;;&
*)
if isdeb; then
pi debian-goodies shellcheck
li)
m /a/h/setup.sh iankelling.org
;;
+ tp)
+ m /a/h/setup.sh -s b8.nz
+ ;;
*)
- # allow symlinks on other hosts so i can host files in arbitrary paths
- m /a/h/setup.sh -s
+ # allow symlinks on non-main hosts so i can host files in arbitrary paths
+ m /a/h/setup.sh -s -p 80
;;
esac
m /a/h/build.rb
# mate doesnt have wayland support yet
pi task-gnome-desktop
;;
+ bionic)
+ pi gnome-core
+ # by default, it sleeps when not logged in to x/wayland and on ac power.
+ # stop that.
+ sudo -u gdm dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
+ systemctl --user stop gvfs-daemon
+ systemctl --user disable gvfs-daemon
+ ;;
esac
+if [[ $codename_compat == flidas ]]; then
+ # doesnt exist in newer
+ pi gnupg-doc
+fi
+# abrowser is not in etiona yet, abrowser version is 68,
+# abrowser won't run on a firefox profile that was on firefox
+# version 70. firefox in ubuntu is at version 70.
+# have to rm compabibility.ini to even try downgrade.
+pi firefox
+sudo update-alternatives --set x-www-browser /usr/bin/firefox
# TODO: some of the X programs can be removed from pall when using wayland
pi ${pall[@]} $(apt-cache search ruby[.0-9]+-doc| awk '{print $1}') $(apt-cache depends gcc|grep -i suggests:| awk '{print $2}') $($src/distro-pkgs)
-sgo fsf-vpn-dns-cleanup
-
-
# website is dead june 14 2019. back in october, but meh
sudo rm -fv /etc/apt/sources.list.d/iridium-browser.list
# case $distro in
######### end irc periodic backup #############
-case $distro in
- debian|trisquel|ubuntu)
- # suggests resolvconf package. installing it here is redundant, but make sure anyways.
- # todo: check other distros to make sure it\'s installed
- pi-nostart openvpn resolvconf
- # pi-nostart does not disable
- ser disable openvpn
- ;;
- *) pi openvpn;;
-esac
+pi-nostart openvpn
+# pi-nostart does not disable
+ser disable openvpn
+
+/p/c/gen-fsf-vpn
m /a/bin/distro-setup/radicale-setup
case $codename in
flidas)
-
- ;;
+ :
+ ;;
esac
# for my roommate
case $distro in
trisquel)
+ # cant do buster due to old gpg
m mkschroot debian stretch firefox-esr pulseaudio chromium
;;
debian)
# in arch, I had to pick out the 6L driver.
-# allow user to run vms, from debian handbook
-for x in iank user2; do s usermod -a -G libvirt,kvm $x; done
# bridge networking as user fails. google lead here, but it doesn\'t work:
# oh well, I give up.
# http://wiki.qemu.org/Features-Done/HelperNetworking
m /a/bin/buildscripts/misc
pi-nostart virtinst virt-manager
-
+# allow user to run vms, from debian handbook
+for x in iank user2; do s usermod -a -G libvirt,kvm $x; done
pi --no-install-recommends kdeconnect
########### misc stuff
-# make networkmanager use resolvconf instead of its own dnsmasq which
-# conflicts with the normal dnsmasq package.
-f=/etc/NetworkManager/NetworkManager.conf
-m=$(md5sum $f)
-sudo sed -ri '/ *\[main\]/,/^ *\[[^]]+\]/{/^\s*dns[[:space:]=]/d}' $f
-sudo sed -ri '/ *\[main\]/a dns=default' $f
-if [[ $m != $(md5sum $f) ]]; then
- srestart NetworkManager
-fi
+case $(debian-codename) in
+ # needed for debootstrap scripts for fai since fai requires debian
+ flidas)
+ pi dnsmasq
+ pi-nostart network-manager
+ # make networkmanager use resolvconf instead of its own dnsmasq which
+ # conflicts with the normal dnsmasq package.
+ f=/etc/NetworkManager/NetworkManager.conf
+ m=$(md5sum $f)
+ sudo sed -ri '/ *\[main\]/,/^ *\[[^]]+\]/{/^\s*dns[[:space:]=]/d}' $f
+ sudo sed -ri '/ *\[main\]/a dns=default' $f
+ if [[ $m != $(md5sum $f) ]]; then
+ srestart NetworkManager
+ fi
+ # networkmanager has this nasty behavior on flidas: if the machine
+ # crashes with dnsmasq running, on subsequent boot, it adds an entry to
+ # resolvconf for 127.0.0.1 in some stupid attempt to restore
+ # nameservers.
+ # This can be manually fixed by stoping dnsmasq,
+ # then based on whats in /run/dnsmasq/, i see we can run
+ # s resolvconf -d NetworkManager
+ # oh ya, and stoping NetworkManager leaves this crap behind without cleaning it up.
+ ser disable NetworkManager
+ ;;
+esac
# make my /etc/fonts/conf.d/ get used.
# I have a new sans-serif font there because the default one
# displays l and I as the same char, grrrrr.
sudo fc-cache
+pi desktop-file-utils
m /a/bin/distro-setup/mymimes
# Remove dep that came in with desktop to fix associations.
m pu transmission-gtk
-sudo gpasswd -a iank adm #needed for reading logs
m /a/bin/buildscripts/pithosfly
# nfs server
pi-nostart nfs-kernel-server
-# networkmanager has this nasty behavior on flidas: if the machine
-# crashes with dnsmasq running, on subsequent boot, it adds an entry to
-# resolvconf for 127.0.0.1 in some stupid attempt to restore
-# nameservers.
-# This can be manually fixed by stoping dnsmasq,
-# then based on whats in /run/dnsmasq/, i see we can run
-# s resolvconf -d NetworkManager
-# oh ya, and stoping NetworkManager leaves this crap behind without cleaning it up.
-ser disable NetworkManager
if [[ $HOSTNAME == frodo ]]; then