Bläddra i källkod

Added try catch code and comments

master
HMSheets 3 år sedan
förälder
incheckning
d51513033f
1 ändrade filer med 34 tillägg och 3 borttagningar
  1. +34
    -3
      refresh-NebulaCA

+ 34
- 3
refresh-NebulaCA Visa fil

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


Laddar…
Avbryt
Spara