From 4764663530e8c13eb86e5527115a8f6dbe5711a6 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 12 Mar 2023 18:39:57 +0100 Subject: [PATCH] use sudo inside bash file --- README.md | 17 ++++++++++++++++- arch_wsl.sh | 14 +++++++------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 92187aa..66f2938 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,25 @@ ## 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 : ```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 diff --git a/arch_wsl.sh b/arch_wsl.sh index 2ab1b78..6621ebf 100644 --- a/arch_wsl.sh +++ b/arch_wsl.sh @@ -13,18 +13,18 @@ cd "$(dirname "$0")" # change script directory main() { # === Init pacman == - pacman-key --init - pacman-key --populate - pacman -S archlinux-keyring --noconfirm + sudo pacman-key --init + sudo pacman-key --populate + sudo pacman -S archlinux-keyring --noconfirm # === Update Arch == - pacman -Syu --noconfirm + sudo pacman -Syu --noconfirm # === Remove packages == - pacman -R --noconfirm fakeroot-tcp + sudo pacman -R --noconfirm fakeroot-tcp # === 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 \ fish autoconf valgrind automake python-virtualenv gdb \ 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 # === 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 "---\nPense bien à paramétrer ton terminal, exemple avec Windows Terminal :"