]> gitweb.morketsmerke.org Git - idle.git/commitdiff
Dodanie funkcji idle-exec-shell - skrypt idle.sh
authorxf0r3m <jakubstasinski@protonmail.com>
Mon, 7 Aug 2023 17:14:50 +0000 (19:14 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Mon, 7 Aug 2023 17:14:50 +0000 (19:14 +0200)
idle.sh

diff --git a/idle.sh b/idle.sh
index 809ae3b4c49ebbfbc68b5213e2c6b02bf2799bde..c3362835c1a6a36cacc389dc2e5604e3a7efeb8b 100644 (file)
--- 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;
+}