]> gitweb.morketsmerke.org Git - idle.git/commitdiff
Dodanie plików 'idle-clic' oraz 'idle-clis' - do testów. Należy rozszerzyć funkcjonal...
authorxf0r3m <jakubstasinski@protonmail.com>
Mon, 7 Aug 2023 11:02:58 +0000 (13:02 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Mon, 7 Aug 2023 11:02:58 +0000 (13:02 +0200)
idle-clic [new file with mode: 0644]
idle-clis [new file with mode: 0644]

diff --git a/idle-clic b/idle-clic
new file mode 100644 (file)
index 0000000..01588f6
--- /dev/null
+++ b/idle-clic
@@ -0,0 +1,39 @@
+#!/bin/bash
+  
+function help() {
+  echo 'idle-clic - IDLE CLI Client';
+  echo '@ 2023 morketsmerke.org';
+  echo;
+  echo 'IDLE commands:';
+  echo '  list-distros - listing available distributions on this server';
+  echo '  shell <distro> - running up the shell in given container';
+  echo '  check-command - checking there is a given command in any container';
+  echo '  apropos <keyword> - return list of commands with short description';
+  echo '   match to given keyword';
+  echo '  pkgsearch <keywords> - searching there is package installed or ready';
+  echo '   to install match to given keywords';
+  echo;
+  echo 'Usage:';
+  echo '  $ idle-clic list-distros';
+  echo '  $ idle-clic shell rocky9';
+  echo '  $ idle-clic check-command netstat';
+  echo '  $ idle-clic apropos zip';
+  echo '  $ idle-clic pkgsearch "intel sound"';
+  echo;
+  echo 'IDLE Configuration:';
+  echo 'In ~/.idle/.idle.conf file (example of this file: /usr/share/idle/idle.conf)';
+  echo '  RUSER="user";';
+  echo '  IDLESERVER="idle.example.org";';
+  echo '  SSH_OPTS="-p 10022 -i ~/id_rsa"; #OPTIONAL';
+}
+
+if [ -f ~/.idle/idle.conf ]; then
+  source ~/.idle/idle.conf;
+  echo "IDLE Server response:";
+  ssh ${SSH_OPTS} ${RUSER}@${IDLESERVER} "idle-clis $@";
+  if [ $? -eq 1 ]; then help; exit 1; fi
+else
+  echo "There is no IDLE config file. Exiting...";
+  help;
+  exit 1;
+fi
diff --git a/idle-clis b/idle-clis
new file mode 100644 (file)
index 0000000..90c200f
--- /dev/null
+++ b/idle-clis
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+if [ $# -gt 0 ]; then
+  source /usr/share/local/idle;
+  command=$1;
+  shift;
+  case $command in
+    "list-distros") idle-list-containers; break;;
+    "shell") idle-exec-shell $2; exit;;
+    "check-command") idle-exec-command $2; exit;;
+    "apropos") idle-apropos $@; exit;;
+    "pkgsearch") idle-pkg-search $@; break;;
+  esac
+else
+  exit 1;
+fi