use sudo inside bash file

This commit is contained in:
Mylloon 2023-03-12 18:39:57 +01:00
parent 25f62583d6
commit 4764663530
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 23 additions and 8 deletions

View file

@ -9,10 +9,25 @@
## WSL (Arch) ## WSL (Arch)
Tout d'abord, installer [ArchWSL](https://github.com/yuk7/ArchWSL/releases)
(.appx et [.cer](https://wsldl-pg.github.io/ArchW-docs/Install-Certificate/))
Ensuite, il faut définir un utilisateur :
```bash
>Arch.exe
[root@PC-NAME]# echo "%wheel ALL=(ALL) ALL" > /etc/sudoers.d/wheel
[root@PC-NAME]# useradd -m -G wheel -s /bin/bash anri
[root@PC-NAME]# passwd anri
[root@PC-NAME]# exit
>Arch.exe config --default-user anri
```
Commande pour lancer mon installation : Commande pour lancer mon installation :
```bash ```bash
curl https://git.mylloon.fr/Anri/confOS/raw/branch/main/arch_wsl.sh -s | sudo bash curl https://git.mylloon.fr/Anri/confOS/raw/branch/main/arch_wsl.sh -s | bash
``` ```
## Arch ## Arch

View file

@ -13,18 +13,18 @@ cd "$(dirname "$0")" # change script directory
main() { main() {
# === Init pacman == # === Init pacman ==
pacman-key --init sudo pacman-key --init
pacman-key --populate sudo pacman-key --populate
pacman -S archlinux-keyring --noconfirm sudo pacman -S archlinux-keyring --noconfirm
# === Update Arch == # === Update Arch ==
pacman -Syu --noconfirm sudo pacman -Syu --noconfirm
# === Remove packages == # === Remove packages ==
pacman -R --noconfirm fakeroot-tcp sudo pacman -R --noconfirm fakeroot-tcp
# === Install packages == # === Install packages ==
pacman -S --noconfirm git wget zip openssh bat base-devel make \ sudo pacman -S --noconfirm git wget zip openssh bat base-devel make \
python-pygments micro git-lfs npm sdl2_image nodejs \ python-pygments micro git-lfs npm sdl2_image nodejs \
fish autoconf valgrind automake python-virtualenv gdb \ fish autoconf valgrind automake python-virtualenv gdb \
tk sdl2_mixer exa texlive-most fzf glu man-pages-fr \ tk sdl2_mixer exa texlive-most fzf glu man-pages-fr \
@ -241,7 +241,7 @@ main() {
wget -q https://git.mylloon.fr/Anri/confOS/raw/branch/main/.unison/default.prf -O "$HOME"/.unison/default.prf wget -q https://git.mylloon.fr/Anri/confOS/raw/branch/main/.unison/default.prf -O "$HOME"/.unison/default.prf
# === Clear useless packages # === Clear useless packages
pacman -Rsn "$(pacman -Qqtd)" 2> /dev/null sudo pacman -Rsn "$(pacman -Qqtd)" 2> /dev/null
echo -e "\nInstallation terminée !\nIl faut redémarrer WSL (dans Powershell = wsl --shutdown)." echo -e "\nInstallation terminée !\nIl faut redémarrer WSL (dans Powershell = wsl --shutdown)."
echo -e "---\nPense bien à paramétrer ton terminal, exemple avec Windows Terminal :" echo -e "---\nPense bien à paramétrer ton terminal, exemple avec Windows Terminal :"