scripts-bash/ecoleA/config-computer.sh

41 lines
1.1 KiB
Bash
Raw Normal View History

2022-11-06 21:27:50 +01:00
#!/bin/bash
# Test du user ROOT
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# Chargement du clavier Français
2022-11-06 21:27:50 +01:00
loadkeys fr
# Modification des droits sudo
2022-11-06 21:27:50 +01:00
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