Skip to content

Commit

Permalink
more minor style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonEverling committed Feb 14, 2024
1 parent 7e4b0c7 commit 196b919
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 50 deletions.
10 changes: 5 additions & 5 deletions src/usr/lib/ocie/types/apache.ocie
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ function app_start()

function app_test()
{
CFG_TEST=$(apachectl configtest 2>&1);
CFG_PASS="Syntax OK";
CFG_RESULT=$(echo "$CFG_TEST" | grep "$CFG_PASS");
if [[ -z "$CFG_RESULT" ]];then
echo "$CFG_RESULT";
local cfg_test=$(apachectl configtest 2>&1);
local cfg_pass="Syntax OK";
local cfg_result=$(echo "${cfg_test}" | grep "${cfg_pass}");
if [[ -z "${cfg_result}" ]];then
echo "${cfg_result}";
fi;
}
18 changes: 9 additions & 9 deletions src/usr/lib/ocie/types/itsm.ocie
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ function app_certs()

function app_config()
{
CUSTOM_CSS=${YOUTRACK_HOME}/conf/custom.css;
STATIC_DIR=${YOUTRACK_HOME}/apps/youtrack/web/static/simplified;
if [[ -f "${CUSTOM_CSS}" ]];then
local custom_css="${YOUTRACK_HOME}/conf/custom.css";
local static_dir="${YOUTRACK_HOME}/apps/youtrack/web/static/simplified";
if [[ -f "${custom_css}" ]];then
#Get generated css
cd ${STATIC_DIR};
STYLE_CSS=$(find ~+ -name 'styles.*.css');
STYLE_LNK=$(basename "${STYLE_CSS}");
cp ${STYLE_CSS} ${YOUTRACK_HOME}/conf/;
cd ${static_dir};
local style_css=$(find ~+ -name 'styles.*.css');
local style_lnk=$(basename "${style_css}");
cp "${style_css}" "${YOUTRACK_HOME}/conf/";

#Add custom css to styles
cat ${CUSTOM_CSS} >> ${YOUTRACK_HOME}/conf/${STYLE_LNK};
cp ${YOUTRACK_HOME}/conf/${STYLE_LNK} ${STATIC_DIR}/;
cat "${custom_css}" >> "${YOUTRACK_HOME}/conf/${style_lnk}";
cp "${YOUTRACK_HOME}/conf/${style_lnk}" "${static_dir}/";
cd /;
fi;
}
14 changes: 7 additions & 7 deletions src/usr/lib/ocie/types/tomcat.ocie
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function app_shutdown()
{
/usr/sbin/apachectl -k stop;
${CATALINA_HOME}/bin/catalina.sh stop;
"${CATALINA_HOME}/bin/catalina.sh" stop;
}

function app_reload()
Expand All @@ -20,11 +20,11 @@ function app_start()

function app_test()
{
TC_TEST=$(/opt/tomcat/bin/catalina.sh configtest 2>&1);
CFG_TEST=$(echo "$TC_TEST" | grep 'Apache Tomcat Native' | sort -u);
CFG_PASS='INFO: Loaded( APR based)? Apache Tomcat Native library';
CFG_RESULT=$(echo "$CFG_TEST" | grep -E "$CFG_PASS");
if [[ -z "$CFG_RESULT" ]];then
echo "$TC_TEST";
local tc_test=$(/opt/tomcat/bin/catalina.sh configtest 2>&1);
local cfg_test=$(echo "$tc_test" | grep 'Apache Tomcat Native' | sort -u);
local cfg_pass='INFO: Loaded( APR based)? Apache Tomcat Native library';
local cfg_result=$(echo "$cfg_test" | grep -E "$cfg_pass");
if [[ -z "$cfg_result" ]];then
echo "$tc_test";
fi;
}
52 changes: 26 additions & 26 deletions src/usr/sbin/ocie
Original file line number Diff line number Diff line change
Expand Up @@ -63,37 +63,37 @@ function get_environment()
printf "%s" "$(</etc/environment)";
echo
echo "Ocie: Package Manifest";
. $OCIE_LIB/pkg --print;
. ${OCIE_LIB}/pkg --print;
}

function format_args()
{
RESULT=$(echo "$1" | sed -e 's/ -/ --/g');
echo "$RESULT";
local result=$(echo "$1" | sed -e 's/ -/ --/g');
echo "${result}";
}

ENTRIES=();
SILENT=0;
local entries=();
local silent=0;

for i in "$@";do
shift
case "$i" in
'--pkg')
ENTRIES+=(["0"]="pkg $(format_args " $1")");;
entries+=(["0"]="pkg $(format_args " $1")");;
'--cacerts')
ENTRIES+=(["1"]="cacerts $(format_args " $1")");;
entries+=(["1"]="cacerts $(format_args " $1")");;
'--dhparams')
ENTRIES+=(["2"]="dhparams $(format_args " $1")");;
entries+=(["2"]="dhparams $(format_args " $1")");;
'--keys')
ENTRIES+=(["3"]="keys $(format_args " $1")");;
entries+=(["3"]="keys $(format_args " $1")");;
'--timezone')
ENTRIES+=(["4"]="timezone $(format_args " $1")");;
entries+=(["4"]="timezone $(format_args " $1")");;
'--clean')
ENTRIES+=(["5"]="clean $(format_args " $1")");;
entries+=(["5"]="clean $(format_args " $1")");;
'--print')
ENTRIES+=(["6"]="print");;
entries+=(["6"]="print");;
'--quiet')
SILENT=1;;
silent=1;;
'--help')
show_help;;
*);;
Expand All @@ -102,20 +102,20 @@ done;

. ${OCIE_LIB}/include/utils;

CMDS=$(<<< ${!ENTRIES[@]} tr ' ' '\n' | sort);
for key in $CMDS;do
ENTRY="$(echo ${ENTRIES[$key]})";
CMD="$(echo ${ENTRY%% *})";
PARAMS="$(echo ${ENTRY#* })";
if [[ -f "${OCIE_LIB}/${CMD}" ]];then
#print_msg "Ocie: Executing [ $CMD ], with arguments: [ $PARAMS ]";
#. $OCIE_LIB/$CMD $PARAMS | print_msg
echo "Ocie: Executing [ $CMD ], with arguments: [ $PARAMS ]";
. $OCIE_LIB/$CMD $PARAMS
elif [[ "${CMD}" == "print" ]];then
local cmds=$(<<< ${!entries[@]} tr ' ' '\n' | sort);
for key in $cmds;do
local entry="$(echo ${entries[$key]})";
local cmd="$(echo ${entry%% *})";
local params="$(echo ${entry#* })";
if [[ -f "${OCIE_LIB}/${cmd}" ]];then
#print_msg "Ocie: Executing [ ${cmd} ], with arguments: [ ${params} ]";
#. ${OCIE_LIB}/${cmd} ${params} | print_msg
echo "Ocie: Executing [ $cmd ], with arguments: [ ${params} ]";
. ${OCIE_LIB}/${cmd} ${params}
elif [[ "${cmd}" == "print" ]];then
get_environment;
else
#print_msg "Ocie: Uknown option passed: [ $CMD ], use --help for more info";
echo "Ocie: Uknown option passed: [ $CMD ], use --help for more info";
#print_msg "Ocie: Uknown option passed: [ ${cmd} ], use --help for more info";
echo "Ocie: Uknown option passed: [ ${cmd} ], use --help for more info";
fi;
done;
6 changes: 3 additions & 3 deletions src/usr/sbin/ociectl
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ function check_volumes()
{
if [[ ! -z "${APP_VOLS}" ]];then
echo "Ocie: Application has defined volumes";
unmapped="";
vols=$(cat /proc/mounts);
local unmapped="";
local vols=$(cat /proc/mounts);
for vol in ${APP_VOLS//:/ };do
mounted=$(echo "$vols" | grep -Eo ".*${vol}.*$");
local mounted=$(echo "$vols" | grep -Eo ".*${vol}.*$");
if [[ ! -z "${mounted}" ]];then
echo "Ocie: Application volume [ ${vol} ] is NOT mapped";
unmapped+="${vol}, ";
Expand Down

0 comments on commit 196b919

Please sign in to comment.