diff options
Diffstat (limited to 'kvmx')
-rwxr-xr-x | kvmx | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -76,7 +76,7 @@ function __kvmx_create_config_entry { # Initialize function __kvmx_initialize { - if [ "$ACTION" == "app_base" ]; then + if [ "$ACTION" == "app_base" ] || [ "$ACTION" == "version" ]; then return fi @@ -1627,6 +1627,27 @@ function kvmx_compress { echo "compression ratio: $ratio" } +# Version +function kvmx_version { + echo $VERSION +} + +# Shell +function kvmx_shell { + # While a "quit" command isn't entered, read STDIN + while read -rep "kvmx:/${USER}@${VM}> " STDIN; do + if [ "$STDIN" == "quit" ] || [ "$STDIN" == "exit" ] || [ "$STDIN" == "bye" ]; then + break + elif [ "$STDIN" == "shell" ]; then + echo "Why you need nesting?" + elif [[ -n "$STDIN" && "$STDIN" != "#"* ]]; then + # If line is not empty or commented, process command + STDIN=($STDIN) + $APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1} + fi + done +} + # Dispatch if type kvmx_$ACTION 2> /dev/null | grep -q "kvmx_$ACTION ()"; then __kvmx_initialize $* |