2020-01-22 13:24:38 +01:00
#!/usr/bin/env bash
2022-08-17 02:36:19 +02:00
# Execute itself with sudo if user is not root.
2020-02-13 21:12:20 +01:00
[ [ $UID -ne 0 ] ] && exec sudo ./" $0 "
2020-01-22 13:24:38 +01:00
###
# Set variables
###
export DEBIAN_FRONTEND = noninteractive
DPKG_CFG_FRAGMENT = /etc/dpkg/dpkg.cfg.d/non-interactive
2023-07-28 20:31:51 +02:00
# Name of the distribution
2024-01-28 18:10:37 +01:00
script_distro = 'Linux Mint 21.3'
2020-01-22 13:24:38 +01:00
# Additional packages
packages = (
2023-01-20 14:22:23 +01:00
# Program packages
2020-01-22 13:24:38 +01:00
libreoffice
keepassxc
gparted
hardinfo
2020-09-23 00:22:56 +02:00
regionset
2020-06-29 02:16:14 +02:00
cheese
2020-01-22 13:24:38 +01:00
vlc
2023-01-20 14:22:23 +01:00
# Language related packages
# Generic
2020-01-22 13:24:38 +01:00
openoffice.org-hyphenation
2023-01-20 14:22:23 +01:00
# AR
language-pack-gnome-ar-base
firefox-locale-ar
fonts-arabeyes
hunspell-ar
libreoffice-l10n-ar
mythes-ar
thunderbird-locale-ar
# DE
2023-07-28 20:31:51 +02:00
language-pack-gnome-de-base # Installed only with Internet connection during the OEM setup.
2023-01-20 14:22:23 +01:00
firefox-locale-de
hunspell-de-at
hunspell-de-ch
hunspell-de-de
2023-07-28 20:31:51 +02:00
thunderbird-locale-de # Installed only with Internet connection during the OEM setup.
2023-01-20 14:22:23 +01:00
# EN
thunderbird-locale-en-gb
# FA
language-pack-gnome-fa-base
firefox-locale-fa
libreoffice-l10n-fa
myspell-fa
thunderbird-locale-fa
# RU
language-pack-gnome-ru-base
firefox-locale-ru
thunderbird-locale-ru
# UK
language-pack-gnome-uk-base
libreoffice-l10n-uk
firefox-locale-uk
thunderbird-locale-uk
hyphen-uk
mythes-uk
hunspell-uk
wukrainian
2020-01-22 13:24:38 +01:00
)
###
# Functions
###
2022-08-17 02:36:19 +02:00
# $*: message to echo.
2020-01-22 13:24:38 +01:00
e( ) {
2023-07-28 20:31:51 +02:00
printf "\e[32m>>>\e[0m %s\n" " $* "
2020-01-22 13:24:38 +01:00
}
2023-07-28 20:31:51 +02:00
# It's a pain to stop execution (CTRL+C, kill) with all the Python applications so we catch SIGINT and SIGTERM and exit immediately.
2020-01-22 13:24:38 +01:00
handle_signal( ) {
2020-06-29 02:16:14 +02:00
e "Ausführung abgebrochen! Skript wird beendet."
2020-01-22 13:24:38 +01:00
exit 1
}
2022-08-17 02:36:19 +02:00
# Always executed when exiting the shell, regardless of the reason.
2020-01-22 13:24:38 +01:00
handle_exit( ) {
2022-08-17 02:36:19 +02:00
e "Finale Aufräumarbeiten werden durchgeführt …"
2020-02-13 21:12:20 +01:00
rm -f " $DPKG_CFG_FRAGMENT "
2022-10-05 02:11:47 +02:00
rm -f /etc/apt/apt.conf.d/01aptproxy
e "Initiales Setup beendet."
2020-01-22 13:24:38 +01:00
}
trap handle_signal SIGINT SIGTERM
trap handle_exit EXIT
pkg( ) {
apt install " $@ " --yes --quiet
}
###
# Greeting
###
echo " \
#####################################
# Computertruhe-Installationsskript #
#####################################
###
# Maintainer: Computertruhe e. V.
# Website: https://computertruhe.de/
2024-01-28 18:10:37 +01:00
# Version: 2.3.2
2021-05-31 22:47:10 +02:00
# Repo: https://codeberg.org/Computertruhe/Setup-Skripte
2020-01-22 13:24:38 +01:00
# Distro: ${script_distro}
###
"
2020-06-29 02:16:14 +02:00
e " Starte initiales Setup für Rechner mit frisch installiertem ' ${ script_distro } ' … "
2020-01-22 13:24:38 +01:00
2022-08-17 02:36:19 +02:00
# Use APT proxy if available.
2023-08-06 20:58:39 +02:00
ping -c 1 apt-proxy > /dev/null 2>& 1
2021-05-02 20:27:33 +02:00
if [ " $? " -eq "0" ] ; then
2022-08-17 02:36:19 +02:00
e "Nutze APT-Proxy."
2021-05-02 20:27:33 +02:00
echo 'Acquire::https::Proxy "http://apt-proxy:3142";' > /etc/apt/apt.conf.d/01aptproxy
echo 'Acquire::http::Proxy "http://apt-proxy:3142";' >> /etc/apt/apt.conf.d/01aptproxy
else
2022-08-17 02:36:19 +02:00
e "Kein APT-Proxy gefunden."
2021-05-02 20:27:33 +02:00
fi
echo 'Dpkg::Options "--force-unsafe-io";' >> /etc/apt/apt.conf.d/01aptproxy
2020-01-22 13:24:38 +01:00
###
# Automatic installation
###
2022-08-17 02:36:19 +02:00
# Place temporary dpkg configurations to ensure non-interactive upgrade.
2020-02-13 21:12:20 +01:00
cat <<'DPKG' >"$DPKG _CFG_FRAGMENT"
force-confold
force-confdef
DPKG
2020-06-29 02:16:14 +02:00
e "Paketquellen aktualisieren …"
2020-02-13 21:12:20 +01:00
apt update --yes --quiet
2020-06-29 02:16:14 +02:00
e "System aktualisieren (apt) …"
2020-02-13 21:12:20 +01:00
apt full-upgrade --yes --quiet
2020-06-29 02:16:14 +02:00
e "System aktualisieren (mintupdate-cli) …"
2020-02-13 21:12:20 +01:00
mintupdate-cli --yes upgrade
2020-06-29 02:16:14 +02:00
e "Proprietäre Treiber installieren (sofern verfügbar) …"
2020-02-13 21:12:20 +01:00
ubuntu-drivers autoinstall
2022-08-17 02:36:19 +02:00
e "Multimedia-Codecs installieren …"
2023-07-28 20:31:51 +02:00
pkg mint-meta-codecs # Installed only with Internet connection during the OEM setup.
2022-07-12 21:00:53 +02:00
2020-06-29 02:16:14 +02:00
e "Zusätzliche Software installieren …"
2020-02-13 21:12:20 +01:00
pkg " ${ packages [@] } "
2020-06-29 02:16:14 +02:00
e "Unnötige Pakete entfernen und Cache bereinigen …"
2020-02-13 21:12:20 +01:00
apt clean --yes --quiet
apt autoremove --yes --quiet
2022-10-15 19:29:52 +02:00
e "Handbuch \"Linux Mint – Handbuch der Computertruhe für Ein- und Umsteiger*innen\" herunterladen …"
2022-10-05 02:11:47 +02:00
mkdir /etc/skel/Desktop
2022-10-15 19:29:52 +02:00
wget -O "/etc/skel/Desktop/Linux Mint – Handbuch der Computertruhe für Ein- und Umsteiger*innen.pdf" https://computertruhe.de/handbuecher/linux_mint.pdf
e "Handbuch \"Besonderheiten von MacBooks im Zusammenhang mit Linux Mint\" herunterladen …"
if [ $( dmidecode -t1 | grep -ci "macbook" ) -ge 1 ]
then
wget -O "/etc/skel/Desktop/Besonderheiten von MacBooks im Zusammenhang mit Linux Mint.pdf" https://computertruhe.de/handbuecher/macbook_linux_mint.pdf
else
e "Das Skript läuft nicht auf einem MacBook."
fi