commit a0ecb7695580cef5594b699944e3372e41e9a690 Author: Alauddin Maulana Hirzan Date: Fri May 31 04:29:16 2024 +0700 Update README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..43ebbee --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# ZSH Custom Functions # + +This repository contains some zsh custom functions. + +## Installations: ## +* Put each folders (not zsh_function, but individual folders) to $HOME/.oh-my-zsh/plugins +* Load using **plugins** module by adding **each folder name** + +## Currently Available: ## +* CBSD Jail control through jctl command with usages: + * jctl list : List All Jails + * jctl create : Create Jail (jconstruct-tui) + * jctl start (jail name) : Start Jail (jstart) + * jctl login (jail name) : Login to Jail (jlogin) + * jctl stop (jail name) : Stop Jail (jstop) + * jctl config (jail name) : Configure Jail (jconfig) + * jctl remove (jail name) : Remove Jail (jremove) diff --git a/cbsd_jail/cbsd_jail.plugin.zsh b/cbsd_jail/cbsd_jail.plugin.zsh new file mode 100644 index 0000000..f47e3a2 --- /dev/null +++ b/cbsd_jail/cbsd_jail.plugin.zsh @@ -0,0 +1,39 @@ +jctl() { + if [[ "$1" == "create" ]]; then + cbsd jconstruct-tui; + elif [[ "$1" == "list" ]]; then + cbsd jls; + elif [[ "$1" == "start" ]]; then + if [[ "$2" != "" ]]; then + cbsd jstart jname="$2" + else + echo "CBSD:Start - Missing Jail Name" + fi + elif [[ "$1" == "stop" ]]; then + if [[ "$2" != "" ]]; then + cbsd jstop jname="$2" + else + echo "CBSD:Stop - Missing Jail Name" + fi + elif [[ "$1" == "config" ]]; then + if [[ "$2" != "" ]]; then + cbsd jconfig jname="$2" + else + echo "CBSD:Config - Missing Jail Name" + fi + elif [[ "$1" == "remove" ]]; then + if [[ "$2" != "" ]]; then + cbsd jremove jname="$2" + else + echo "CBSD:Remove - Missing Jail Name" + fi + elif [[ "$1" == "login" ]]; then + if [[ "$2" != "" ]]; then + cbsd jlogin jname="$2" + else + echo "CBSD:Remove - Missing Jail Name" + fi + else + echo "CBSD - Missing Switch"; + fi +}