#!/bin/bash
# configureerd nieuwe client
# 9-8-2016

# sources.list
cd /tmp
mv /etc/apt/sources.list /etc/apt/sources.list-org
wget http://vandervlis.nl/files/sources.list
mv sources.list /etc/apt/sources.list

# rpl
apt-get -y install rpl

# contrib nonfree
rpl main "main contrib non-free" /etc/apt/sources.list

apt-get update

# unattended upgrades
apt-get -y install unattended-upgrades
if ! test $? = 0; then echo "niet gelukt"; exit; fi
cd /tmp
wget vandervlis.nl/files/10periodic
wget vandervlis.nl/files/50unattended-upgrades
mv 10periodic /etc/apt/apt.conf.d/
mv 50unattended-upgrades /etc/apt/apt.conf.d/
unattended-upgrade --debug --dry-run

# nog wat software
apt-get -y install chromium chromium-l10n
apt-get -y install icedove icedove-l10n-nl
apt-get -y install iceowl-extension iceowl-l10n-nl
apt-get -y install xul-ext-sogo-connector
apt-get -y -t jessie-backports install xserver-xorg-video-intel
apt-get -y -t jessie-backports install libreoffice libreoffice-sbc-firebird libreoffice-sbc-hsqldb \
   libreoffice-help-en-us libreoffice-help-nl libreoffice-report-builder-bin avmedia-backend-gstreamer

# my firewall:
cd /usr/local/sbin
wget http://vandervlis.nl/files/firewall-laptop
mv /usr/local/sbin/firewall-laptop /usr/local/sbin/firewall
chmod +x /usr/local/sbin/firewall
wget http://www.vandervlis.nl/files/firewall-init
mv firewall-init /etc/init.d/firewall
chmod +x /etc/init.d/firewall
insserv firewall
/etc/init.d/firewall start

# noatime
# rpl "errors=remount-ro 0" "errors=remount-ro,noatime 0" /etc/fstab

# closed Intel:
# apt-get -y install firmware-iwlwifi
# apt-get -y install intel-microcode

# flash
# apt-get -y install pepperflashplugin-nonfree
# apt-get -y -t jessie-backports install browser-plugin-freshplayer-pepperflash

# flash update
# wget vandervlis.nl/files/flash-update
# mv flash-update /etc/cron.d/
# chmod 644 /etc/cron.d/flash-update

# ufw firewall:
# apt-get -y install ufw gufw
# rpl "ENABLED=no" "ENABLED=yes" /etc/ufw/ufw.conf

# apt-get -y -t jessie-backports install linux-image-amd64 firmware-iwlwifi

# instellingen in cinnamon, onzin, want moet als user!
# dconf write /org/cinnamon/desktop/screensaver/lock-enabled false
# dconf write /org/gnome/libgnomekbd/keyboard/layouts "['us\taltgr-intl','us']"
