49
49
# than 24 hours for the encrypt key.
50
50
readonly KEY_ROTATION=' 0 0,12 * * *'
51
51
52
- # The nginx restart interval as cron mask.
52
+ # The nginx rotation interval as cron mask.
53
53
#
54
54
# 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 * * *'
58
58
59
59
# Absolute path to the web server system startup program.
60
60
readonly SERVER_INIT_PATH=' /etc/init.d/nginx'
@@ -165,11 +165,11 @@ change_owner_and_make_scripts_executable()
165
165
# 1 - Not available
166
166
check_filesystem ()
167
167
{
168
- if grep -qs ramfs " ${1} "
168
+ if grep -q ramfs " ${1} "
169
169
then
170
170
FILESYSTEM=' ramfs'
171
171
ok " Using ${YELLOW} ramfs${NORMAL} "
172
- elif grep -qs tmpfs " ${1} "
172
+ elif grep -q tmpfs " ${1} "
173
173
then
174
174
FILESYSTEM=' tmpfs'
175
175
warn " Using ${YELLOW} tmpfs${NORMAL} which means that your keys \
@@ -289,7 +289,7 @@ least version ${YELLOW}${2}${NORMAL}"
289
289
#
290
290
# GLOBALS:
291
291
# $KEY_ROTATION - The key rotation cron mask.
292
- # $SERVER_RELOAD - The server reload cron mask.
292
+ # $SERVER_ROTATION - The server rotation cron mask.
293
293
# $SERVER - The name of the server daemon.
294
294
# ARGS:
295
295
# $1 - Absolute path to the cron file.
@@ -308,7 +308,7 @@ create_cron_job()
308
308
# ------------------------------------------------------------------------------
309
309
310
310
${KEY_ROTATION} sh -- '${2} ' ${3}
311
- ${SERVER_RELOAD } service ${SERVER} reload
311
+ ${SERVER_ROTATION } service ${SERVER} reload
312
312
313
313
EOT
314
314
ok " Created cron rotation job ${YELLOW}${1}${NORMAL} "
@@ -576,7 +576,7 @@ uninstall()
576
576
[ " ${VERBOSE} " = true ] && printf -- ' Uninstalling ...\n'
577
577
578
578
INIT_NAME=" ${INIT_PATH##*/ } "
579
- if grep -qs -- " \$ ${INIT_NAME} " " ${SERVER_INIT_PATH} "
579
+ if grep -q -- " \$ ${INIT_NAME} " " ${SERVER_INIT_PATH} "
580
580
then
581
581
sed -i -- " s/ \$ ${INIT_NAME} //g" " ${SERVER_INIT_PATH} "
582
582
ok " Removed system startup dependency in ${YELLOW}${SERVER_INIT_PATH}${NORMAL} "
@@ -603,15 +603,15 @@ uninstall()
603
603
ok " Cron program ${YELLOW}${CRON_PATH}${NORMAL} already removed"
604
604
fi
605
605
606
- if grep -qs -- " ${FSTAB_COMMENT} " /etc/fstab
606
+ if grep -q -- " ${FSTAB_COMMENT} " /etc/fstab
607
607
then
608
608
sed -i -- " /${FSTAB_COMMENT} /,+1 d" ' /etc/fstab'
609
609
ok " Removed ${YELLOW} /etc/fstab${NORMAL} entry"
610
610
else
611
611
ok " No entry found in ${YELLOW} /etc/fstab${NORMAL} "
612
612
fi
613
613
614
- if grep -qs -- " ${KEY_PATH} " /proc/mounts
614
+ if grep -q -- " ${KEY_PATH} " /proc/mounts
615
615
then
616
616
umount -fl -- " ${KEY_PATH} "
617
617
ok " Unmounted ${YELLOW}${KEY_PATH}${NORMAL} "
@@ -631,14 +631,14 @@ uninstall()
631
631
return 0
632
632
}
633
633
634
- # Display usage text.
634
+ # Print usage text.
635
635
#
636
636
# GLOBAL:
637
637
# $ARGUMENTS - Program argument description.
638
638
# $DESCRIPTION - Description what the program does.
639
639
# RETURN:
640
- # 0 - If usage was printed to `stdout` .
641
- # 1 - If printing failed.
640
+ # 0 - Printing successful .
641
+ # 1 - Printing failed.
642
642
usage ()
643
643
{
644
644
cat << EOT
0 commit comments