-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·26 lines (20 loc) · 952 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
current_dir=$PWD
# edit crontab to run all script
SCRIPT="$current_dir/install_packages.sh"
echo "@reboot $SCRIPT >> /home/ivm/install_log 2>&1" | crontab -
# allow atomatic login to run everything
echo "[daemon]" | sudo tee -a /etc/gdm3/custom.conf
echo "AutomaticLoginEnable=true" | sudo tee -a /etc/gdm3/custom.conf
echo "AutomaticLogin=$USER" | sudo tee -a /etc/gdm3/custom.conf
# retirer le mot de passe pour sudo
# Définir la commande à ajouter au fichier sudoers
NEW_SUDO_RULE="ivm ALL=(ALL) NOPASSWD: ALL"
# Ajouter la nouvelle règle au fichier sudoers en utilisant visudo
echo "$NEW_SUDO_RULE" | sudo EDITOR="tee -a" visudo -f /etc/sudoers
echo "Defaults timestamp_timeout=100" | sudo tee -a /etc/sudoers
# mask sleep
sudo systemctl mask sleep.target
echo "$(date +'%Y-%m-%d %H:%M:%S') ---------- INSTALLATION CONFIG INSTALLATION -------" >> /home/ivm/install_log
# reboot pour installer la config sudo crontab
sudo reboot