4949# than 24 hours for the encrypt key.
5050readonly KEY_ROTATION=' 0 0,12 * * *'
5151
52- # The nginx restart interval as cron mask.
52+ # The nginx rotation interval as cron mask.
5353#
5454# This should be after the keys have been rotated (see $KEY_ROTATION). Note
55- # that keys are only in-use after nginx has been restarted . This is very
56- # important if you're syncing the keys within a cluster.
57- readonly SERVER_RELOAD =' 30 0,12 * * *'
55+ # that keys are only in-use after nginx has read them . This is very important if
56+ # you're syncing the keys within a cluster.
57+ readonly SERVER_ROTATION =' 30 0,12 * * *'
5858
5959# Absolute path to the web server system startup program.
6060readonly SERVER_INIT_PATH=' /etc/init.d/nginx'
@@ -165,11 +165,11 @@ change_owner_and_make_scripts_executable()
165165# 1 - Not available
166166check_filesystem ()
167167{
168- if grep -qs ramfs " ${1} "
168+ if grep -q ramfs " ${1} "
169169 then
170170 FILESYSTEM=' ramfs'
171171 ok " Using ${YELLOW} ramfs${NORMAL} "
172- elif grep -qs tmpfs " ${1} "
172+ elif grep -q tmpfs " ${1} "
173173 then
174174 FILESYSTEM=' tmpfs'
175175 warn " Using ${YELLOW} tmpfs${NORMAL} which means that your keys \
@@ -289,7 +289,7 @@ least version ${YELLOW}${2}${NORMAL}"
289289#
290290# GLOBALS:
291291# $KEY_ROTATION - The key rotation cron mask.
292- # $SERVER_RELOAD - The server reload cron mask.
292+ # $SERVER_ROTATION - The server rotation cron mask.
293293# $SERVER - The name of the server daemon.
294294# ARGS:
295295# $1 - Absolute path to the cron file.
@@ -308,7 +308,7 @@ create_cron_job()
308308# ------------------------------------------------------------------------------
309309
310310${KEY_ROTATION} sh -- '${2} ' ${3}
311- ${SERVER_RELOAD } service ${SERVER} reload
311+ ${SERVER_ROTATION } service ${SERVER} reload
312312
313313EOT
314314 ok " Created cron rotation job ${YELLOW}${1}${NORMAL} "
@@ -576,7 +576,7 @@ uninstall()
576576 [ " ${VERBOSE} " = true ] && printf -- ' Uninstalling ...\n'
577577
578578 INIT_NAME=" ${INIT_PATH##*/ } "
579- if grep -qs -- " \$ ${INIT_NAME} " " ${SERVER_INIT_PATH} "
579+ if grep -q -- " \$ ${INIT_NAME} " " ${SERVER_INIT_PATH} "
580580 then
581581 sed -i -- " s/ \$ ${INIT_NAME} //g" " ${SERVER_INIT_PATH} "
582582 ok " Removed system startup dependency in ${YELLOW}${SERVER_INIT_PATH}${NORMAL} "
@@ -603,15 +603,15 @@ uninstall()
603603 ok " Cron program ${YELLOW}${CRON_PATH}${NORMAL} already removed"
604604 fi
605605
606- if grep -qs -- " ${FSTAB_COMMENT} " /etc/fstab
606+ if grep -q -- " ${FSTAB_COMMENT} " /etc/fstab
607607 then
608608 sed -i -- " /${FSTAB_COMMENT} /,+1 d" ' /etc/fstab'
609609 ok " Removed ${YELLOW} /etc/fstab${NORMAL} entry"
610610 else
611611 ok " No entry found in ${YELLOW} /etc/fstab${NORMAL} "
612612 fi
613613
614- if grep -qs -- " ${KEY_PATH} " /proc/mounts
614+ if grep -q -- " ${KEY_PATH} " /proc/mounts
615615 then
616616 umount -fl -- " ${KEY_PATH} "
617617 ok " Unmounted ${YELLOW}${KEY_PATH}${NORMAL} "
@@ -631,14 +631,14 @@ uninstall()
631631 return 0
632632}
633633
634- # Display usage text.
634+ # Print usage text.
635635#
636636# GLOBAL:
637637# $ARGUMENTS - Program argument description.
638638# $DESCRIPTION - Description what the program does.
639639# RETURN:
640- # 0 - If usage was printed to `stdout` .
641- # 1 - If printing failed.
640+ # 0 - Printing successful .
641+ # 1 - Printing failed.
642642usage ()
643643{
644644 cat << EOT
0 commit comments