From 9557226f15bd86e4631c3b86cbb2ed9a2e58d5db Mon Sep 17 00:00:00 2001 From: Kevin Puertas Date: Tue, 29 Aug 2017 17:10:54 +0200 Subject: [PATCH] Fix bug with sudo command --- installer/installer.sh | 45 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/installer/installer.sh b/installer/installer.sh index 3ad760d..e53aa0c 100755 --- a/installer/installer.sh +++ b/installer/installer.sh @@ -68,7 +68,7 @@ function pacmanerror { fi } -##This function logs and execute commands +##This function execute the commands function execl { local command if [[ $1 != "chroot" && $1 != "chuser" ]];then #If it runs normally @@ -81,7 +81,6 @@ function execl { chroot /mnt /bin/bash -c "su $nameuser -c \"$command\" " fi fi - } ##Function for show to the user if an option is on or off @@ -624,37 +623,37 @@ if [[ ! -f "jkarch" ]];then chmod +x installer.sh # Grow cowspace showdo "Grow cowspace for installer" - execl sudo mount -o remount,size=700M /run/archiso/cowspace + execl mount -o remount,size=700M /run/archiso/cowspace #Enable pacman showdo "Configuring pacman" "1" - execl sudo pacman-key --init - execl sudo pacman-key --populate - execl sudo pacman -Sy archlinux-keyring --noconfirm + execl pacman-key --init + execl pacman-key --populate + execl pacman -Sy archlinux-keyring --noconfirm showdo "Configuring pacman" "2" showdo "Updating mirrors" "1" - execl sudo pacman -S reflector --noconfirm - execl sudo reflector --verbose -l 6 --sort rate --save /etc/pacman.d/mirrorlist + execl pacman -S reflector --noconfirm + execl reflector --verbose -l 6 --sort rate --save /etc/pacman.d/mirrorlist showdo "Updated mirrors" "2" #Delete programs (For not updating it) - sudo pacman -R clonezilla darkhttpd diffutils grml-zsh-config irssi linux-atm lvm2 man-db man-pages mc ndisc6 nmap smartmontools testdisk vi vim vim-runtime openconnect pcsclite python2 python reflector --noconfirm - sudo rm -rf /var/cache/pacman/pkg/* + pacman -R clonezilla darkhttpd diffutils grml-zsh-config irssi linux-atm lvm2 man-db man-pages mc ndisc6 nmap smartmontools testdisk vi vim vim-runtime openconnect pcsclite python2 python reflector --noconfirm + rm -rf /var/cache/pacman/pkg/* #Needed progs (gparted) - sudo pacman -S gparted xf86-video-vesa xorg-xinit lwm xorg-xrandr xterm --noconfirm - sudo rm -rf /var/cache/pacman/pkg/* + pacman -S gparted xf86-video-vesa xorg-xinit lwm xorg-xrandr xterm --noconfirm + rm -rf /var/cache/pacman/pkg/* #Update progs - sudo pacman -Su --noconfirm --ignore linux #Do not upgrade kernel automatically - sudo rm -rf /var/cache/pacman/pkg/* - sudo rm /etc/X11/xinit/xinitrc - sudo touch /etc/X11/xinit/xinitrc - sudo chmod 777 /etc/X11/xinit/xinitrc - sudo echo "#Start gparted with startx command" > /etc/X11/xinit/xinitrc - sudo echo "lwm &" >> /etc/X11/xinit/xinitrc - sudo echo "xrandr -s 1024x768 -r 60" >> /etc/X11/xinit/xinitrc - sudo echo "xterm -e '/root/installer.sh' -geometry 120x35" >> /etc/X11/xinit/xinitrc - sudo chmod 644 /etc/X11/xinit/xinitrc - sudo rm -rf /var/cache/pacman/pkg/* + pacman -Su --noconfirm --ignore linux #Do not upgrade kernel automatically + rm -rf /var/cache/pacman/pkg/* + rm /etc/X11/xinit/xinitrc + touch /etc/X11/xinit/xinitrc + chmod 777 /etc/X11/xinit/xinitrc + echo "#Start gparted with startx command" > /etc/X11/xinit/xinitrc + echo "lwm &" >> /etc/X11/xinit/xinitrc + echo "xrandr -s 1024x768 -r 60" >> /etc/X11/xinit/xinitrc + echo "xterm -e '/root/installer.sh' -geometry 120x35" >> /etc/X11/xinit/xinitrc + chmod 644 /etc/X11/xinit/xinitrc + rm -rf /var/cache/pacman/pkg/* #Download translations wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/installer/translations.sh -O /root/translations.sh