From: xf0r3m Date: Mon, 7 Aug 2023 11:02:58 +0000 (+0200) Subject: Dodanie plików 'idle-clic' oraz 'idle-clis' - do testów. Należy rozszerzyć funkcjonal... X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=b94456df516db615ee652cb24daeb2e9cd8e45fc;p=idle.git Dodanie plików 'idle-clic' oraz 'idle-clis' - do testów. Należy rozszerzyć funkcjonalność głównej biblioteki idle o polecenia zapisane w '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