mirror of
https://github.com/10h30/ols-docker-env.git
synced 2026-05-12 15:21:24 +09:00
cert.sh
This commit is contained in:
@@ -25,11 +25,32 @@ fst_match_after(){
|
||||
lst_match_line(){
|
||||
fst_match_after ${1} ${2} '}'
|
||||
LAST_LINE_NUM=$((${FIRST_LINE_NUM}+${FIRST_NUM_AFTER}-1))
|
||||
}
|
||||
}
|
||||
|
||||
check_input(){
|
||||
if [ -z "${1}" ]; then
|
||||
help_message
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_www(){
|
||||
CHECK_WWW=$(echo ${1} | cut -c1-4)
|
||||
if [[ ${CHECK_WWW} == www. ]] ; then
|
||||
echo 'www domain shoudnt be passed!'
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
www_domain(){
|
||||
check_www ${1}
|
||||
WWW_DOMAIN=$(echo www.${1})
|
||||
}
|
||||
|
||||
add_domain(){
|
||||
dot_escape ${1}
|
||||
DOMAIN=${ESCAPE}
|
||||
www_domain ${1}
|
||||
check_duplicate "member.*${DOMAIN}" ${HTTPD_CONF}
|
||||
if [ "${CK_RESULT}" != '' ]; then
|
||||
echo "# It appears the domain already exist! Check the ${HTTPD_CONF} if you believe this is a mistake!"
|
||||
@@ -37,7 +58,7 @@ add_domain(){
|
||||
else
|
||||
perl -0777 -p -i -e 's/(vhTemplate centralConfigLog \{[^}]+)\}*(^.*listeners.*$)/\1$2
|
||||
member '${1}' {
|
||||
vhDomain '${1}'
|
||||
vhDomain '${1},${WWW_DOMAIN}'
|
||||
}/gmi' ${HTTPD_CONF}
|
||||
fi
|
||||
}
|
||||
@@ -56,6 +77,7 @@ del_domain(){
|
||||
fi
|
||||
}
|
||||
|
||||
check_input ${1}
|
||||
while [ ! -z "${1}" ]; do
|
||||
case ${1} in
|
||||
-[hH] | -help | --help)
|
||||
@@ -69,7 +91,7 @@ while [ ! -z "${1}" ]; do
|
||||
;;
|
||||
*)
|
||||
help_message
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
Reference in New Issue
Block a user