Mise à jour de 'ecoleA/config-computer.sh'

Ajout de la gestion de Firefox SNAP

Test du user ROOT
This commit is contained in:
Cédric Abonnel 2022-12-12 13:54:41 +01:00
parent dd9e7a02ff
commit 1c2cd7786c
1 changed files with 34 additions and 0 deletions

View File

@ -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