From b94456df516db615ee652cb24daeb2e9cd8e45fc Mon Sep 17 00:00:00 2001 From: xf0r3m Date: Mon, 7 Aug 2023 13:02:58 +0200 Subject: [PATCH] =?utf8?q?Dodanie=20plik=C3=B3w=20'idle-clic'=20oraz=20'id?= =?utf8?q?le-clis'=20-=20do=20test=C3=B3w.=20Nale=C5=BCy=20rozszerzy=C4=87?= =?utf8?q?=20funkcjonalno=C5=9B=C4=87=20g=C5=82=C3=B3wnej=20biblioteki=20i?= =?utf8?q?dle=20o=20polecenia=20zapisane=20w=20'idle-clis'.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- idle-clic | 39 +++++++++++++++++++++++++++++++++++++++ idle-clis | 16 ++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 idle-clic create mode 100644 idle-clis diff --git a/idle-clic b/idle-clic new file mode 100644 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 - running up the shell in given container'; + echo ' check-command - checking there is a given command in any container'; + echo ' apropos - return list of commands with short description'; + echo ' match to given keyword'; + echo ' pkgsearch - 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 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 -- 2.39.5