Merge branch 'master' of https://gitlab.com/fschl/dotfiles
* 'master' of https://gitlab.com/fschl/dotfiles: fix docker install step update install script
This commit is contained in:
commit
8512af12b2
|
@ -10,12 +10,12 @@ SUDO="sudo"
|
|||
check_root() {
|
||||
# We need root rights at some point
|
||||
if [ "$(whoami)" != "root" ]; then
|
||||
if ! which $SUDO >/dev/null; then
|
||||
echo "ERROR: $0 is not run as root and $SUDO is not available" >&2
|
||||
exit 1
|
||||
fi
|
||||
if ! which $SUDO >/dev/null; then
|
||||
echo "ERROR: $0 is not run as root and $SUDO is not available" >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
SUDO="" # We're already root
|
||||
SUDO="" # We're already root
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -23,17 +23,25 @@ apt_sources() {
|
|||
# http://deb.debian.org/
|
||||
ddist=$1
|
||||
DIST="${ddist:-stable}"
|
||||
if [[ ! "stable" -eq ${DIST} ]]; then
|
||||
cat <<-EOF > /etc/apt/sources.list
|
||||
deb https://deb.debian.org/debian ${DIST} main contrib
|
||||
deb https://deb.debian.org/debian-security ${DIST}/updates main contrib
|
||||
EOF
|
||||
else
|
||||
cat <<-EOF > /etc/apt/sources.list
|
||||
deb https://deb.debian.org/debian stable main contrib
|
||||
deb https://deb.debian.org/debian-security stable-updates main contrib
|
||||
EOF
|
||||
|
||||
allowed_dists=("testing stable stretch buster")
|
||||
if [ ! ${DIST} in "${allowed_dists[@]}" ]; then
|
||||
echo "... $DIST was not in allowed dists... setting to stable"
|
||||
DIST="stable"
|
||||
fi
|
||||
|
||||
echo "writing /etc/apt/sources.list..."
|
||||
echo "using ${DIST}"
|
||||
cat <<-EOF > /etc/apt/sources.list
|
||||
deb http://deb.debian.org/debian ${DIST} main
|
||||
deb-src http://deb.debian.org/debian ${DIST} main
|
||||
|
||||
deb http://deb.debian.org/debian-security/ ${DIST}/updates main
|
||||
deb-src http://deb.debian.org/debian-security/ ${DIST}/updates main
|
||||
|
||||
deb http://deb.debian.org/debian ${DIST}-updates main
|
||||
deb-src http://deb.debian.org/debian ${DIST}-updates main
|
||||
EOF
|
||||
}
|
||||
|
||||
base_applications() {
|
||||
|
@ -59,8 +67,8 @@ base_applications() {
|
|||
gcc \
|
||||
git \
|
||||
gnupg \
|
||||
gnupg-agent \
|
||||
gnupg \
|
||||
gnupg-agent \
|
||||
gnupg2 \
|
||||
grep \
|
||||
htop \
|
||||
|
@ -104,13 +112,15 @@ install_server_base() {
|
|||
apt clean
|
||||
|
||||
echo "setting up logwatch..."
|
||||
echo "... TODO require email to be set as parameter"
|
||||
echo "... TODO require email to be set as parameter"
|
||||
cat <<-EOF > /etc/cron.daily/00logwatch
|
||||
/usr/sbin/logwatch --output mail --mailto you@example.com --detail high
|
||||
|
||||
EOF
|
||||
echo " ... DONE"
|
||||
|
||||
# TODO: is this really needed?
|
||||
# TODO: is this really needed? or default behavior anyway?
|
||||
echo "set unattended upgrades..."
|
||||
cat <<-EOF > /etc/apt/apt.conf.d/10periodic
|
||||
APT::Periodic::Update-Package-Lists "1";
|
||||
|
@ -123,7 +133,6 @@ EOF
|
|||
|
||||
}
|
||||
|
||||
|
||||
no_suspend() {
|
||||
# https://wiki.debian.org/SystemdSuspendSedation
|
||||
$SUDO sed -i "s/HandleLidSwitch=.*/HandleLidSwitch=ignore/" /etc/systemd/logind.conf
|
||||
|
@ -149,15 +158,16 @@ install_nvidia_docker() {
|
|||
sudo apt-get install -y nvidia-docker2
|
||||
sudo pkill -SIGHUP dockerd
|
||||
}
|
||||
|
||||
install_i3() {
|
||||
echo "update and installing i3wm and some tools..."
|
||||
|
||||
# tlp: Advanced Linux Power Management
|
||||
# http://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html
|
||||
deb http://repo.linrunner.de/debian sid main
|
||||
# deb http://repo.linrunner.de/debian sid main
|
||||
|
||||
# add the tlp apt-repo gpg key
|
||||
apt-key adv --keyserver pool.sks-keyservers.net --recv-keys CD4E8809
|
||||
# apt-key adv --keyserver pool.sks-keyservers.net --recv-keys CD4E8809
|
||||
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
|
@ -170,10 +180,12 @@ install_i3() {
|
|||
clipit \
|
||||
emacs \
|
||||
feh \
|
||||
firefox-esr \
|
||||
fonts-font-awesome \
|
||||
fswebcam \
|
||||
i3 \
|
||||
i3lock \
|
||||
i3lock-fancy \
|
||||
i3status \
|
||||
keepassxc \
|
||||
pulseaudio \
|
||||
|
@ -231,7 +243,6 @@ EOF
|
|||
docker-ce \
|
||||
--no-install-recommends
|
||||
|
||||
groupadd docker
|
||||
addgroup ${USERNAME} docker
|
||||
|
||||
docker version
|
||||
|
@ -242,7 +253,7 @@ install_compose() {
|
|||
# https://github.com/docker/compose/releases
|
||||
# btw: *not* for raspbian! you got 3 choices: hypriot, install via pip or build yourself
|
||||
# https://www.berthon.eu/2017/getting-docker-compose-on-raspberry-pi-arm-the-easy-way/
|
||||
VERS="1.21.2"
|
||||
VERS="1.23.2"
|
||||
FILE="docker-compose-$(uname -s)-$(uname -m)"
|
||||
echo "installing docker-compose $VERS ... curling from github"
|
||||
|
||||
|
@ -404,7 +415,7 @@ main() {
|
|||
|
||||
case "$cmd" in
|
||||
base)
|
||||
apt_sources
|
||||
apt_sources stable
|
||||
base_applications
|
||||
install_docker
|
||||
install_compose
|
||||
|
@ -417,6 +428,7 @@ main() {
|
|||
;;
|
||||
desktop)
|
||||
install_i3
|
||||
apt_sources buster
|
||||
if [ -f "./get_private_stuff.sh" ]; then
|
||||
source get_private_stuff.sh
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue