From: xf0r3m Date: Mon, 7 Aug 2023 17:14:50 +0000 (+0200) Subject: Dodanie funkcji idle-exec-shell - skrypt idle.sh X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=0d7cbbc5d9e04630e713685f74ca32e0aaffef9a;p=idle.git Dodanie funkcji idle-exec-shell - skrypt idle.sh --- diff --git a/idle.sh b/idle.sh index 809ae3b..c336283 100644 --- a/idle.sh +++ b/idle.sh @@ -150,3 +150,9 @@ function idle-fetch-containers() { fi fi } + +function idle-exec-shell() { + containerName=$1; + defaultContainerUser=$(grep ";${containerName};" $DATABASE | cut -d ";" -f 5); + lxc exec $containerName -- sudo --login --user $defaultContainerUser; +}