Update README.md

This commit is contained in:
Alauddin Maulana Hirzan 2024-05-31 04:29:16 +07:00
commit a0ecb76955
Signed by: maulanahirzan
GPG key ID: 484DAC952787FA13
2 changed files with 56 additions and 0 deletions

17
README.md Normal file
View file

@ -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)

View file

@ -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
}