From 63a610fcfde8dbce1d6b0c46e80642f191b9fc20 Mon Sep 17 00:00:00 2001 From: Vitalijss Date: Tue, 6 Dec 2022 21:18:26 +0200 Subject: [PATCH] SUDO check --- bash/kubuntu-skola.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bash/kubuntu-skola.sh b/bash/kubuntu-skola.sh index 2b811f9..c3e1231 100644 --- a/bash/kubuntu-skola.sh +++ b/bash/kubuntu-skola.sh @@ -1,12 +1,9 @@ #!/bin/bash -if (( $EUID != 0 )); then - echo "Palaid šo ar root tiesībām!" - exit -fi +if [ "$(id -u)" -ne 0 ]; then echo "Tev jābūt SUDO tiesībām." >&2; exit 1; fi #Atjauninām repozitorijus un atjauninām sistēmu apt update && apt upgrade -y #Instalējam pamata programmas -apt install p7zip vlc unrar git htop mc +apt install p7zip vlc unrar git htop mc curl wget #Izveidojam lietotājus $pass = "Parole1" useradd -m -p "$pass" sk1dt