Browse Source

Added try catch code and comments

master
HMSheets 3 years ago
parent
commit
d51513033f
1 changed files with 34 additions and 3 deletions
  1. +34
    -3
      refresh-NebulaCA

+ 34
- 3
refresh-NebulaCA View File

@@ -7,12 +7,42 @@
# Created By: HMSheets
######################################################

invalid_args_msg () {
echo "Invalid Parameter(s) Entered: $1"
# Try Catch Functions
function try()
{
[[ $- = *e* ]]; SAVED_OPT_E=$?
set +e
}

function throw()
{
exit $1
}

function catch()
{
export ex_code=$?
(( $SAVED_OPT_E )) && set +e
return $ex_code
}

function throwErrors()
{
set -e
}

function ignoreErrors()
{
set +e
}

# Parameter Eval Fuctions
function invalid_args_msg () {
echo "Invalid Parameter(s) Entered"
exit
}

help_msg () {
function help_msg () {
echo "Usage of refresh-NebulaCA <flags>: refresh an existing nebula ca"
echo " -n|--caname"
echo " Name to use for the new CA. Used in the CA cert file and in the filename"
@@ -27,6 +57,7 @@ help_msg () {
exit
}

# Parameter Evaluation while loop
POSITIONAL=()
while [[ $# -gt 0 ]]
do


Loading…
Cancel
Save