From 1c2cd7786c64decfdf8bb89583830b5c24d36fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Abonnel?= Date: Mon, 12 Dec 2022 13:54:41 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'ecoleA/config-comp?= =?UTF-8?q?uter.sh'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ajout de la gestion de Firefox SNAP Test du user ROOT --- ecoleA/config-computer.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/ecoleA/config-computer.sh b/ecoleA/config-computer.sh index 0671513..a1aa20d 100644 --- a/ecoleA/config-computer.sh +++ b/ecoleA/config-computer.sh @@ -1,6 +1,40 @@ #!/bin/bash + +# Test du user ROOT +if [ "$EUID" -ne 0 ] + then echo "Please run as root" + exit +fi + +# Chargement du clavier Français loadkeys fr +# Modification des droits sudo USER_DO=aoste echo "$USER_DO ALL=(ALL:ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/010-$USER_DO-nopassword +# Firefox : suppression du snap +snap remove firefox +dirName=~/snap +# Firefox : suppression des paramètres +if [ -d "${dirName}" ]; then + cd "${dirName}" + dirName=~/snap/firefox + if [ -d "${dirName}" ]; then + rm -r "${dirName}" + fi +fi +# Firefox : ajout de la référence PPA +filenameEdit=/etc/apt/preferences.d/firefox-no-snap +if [ ! -f "${filenameEdit}" ]; then + echo "Package: firefox*" | tee "${filenameEdit}" + echo "Pin: release o=Ubuntu*" | tee -a "${filenameEdit}" + echo "Pin-Priority: -1" | tee -a "${filenameEdit}" +fi +# Firefox : installation +apt purge firefox +add-apt-repository ppa:mozillateam/firefox +apt-get update +apt install firefox +# Firefox : Unattended-Upgrade +echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox