mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
change monit_exec_path to monitrc_path
This commit is contained in:
parent
0faba2e31d
commit
c3e1745dff
@ -10,7 +10,7 @@ fi
|
|||||||
monit_pid_path=${MONIT_PID_PATH:=$HOME/.bigchaindb-monit/monit_processes}
|
monit_pid_path=${MONIT_PID_PATH:=$HOME/.bigchaindb-monit/monit_processes}
|
||||||
monit_script_path=${MONIT_SCRIPT_PATH:=$HOME/.bigchaindb-monit/monit_script}
|
monit_script_path=${MONIT_SCRIPT_PATH:=$HOME/.bigchaindb-monit/monit_script}
|
||||||
monit_log_path=${MONIT_LOG_PATH:=$HOME/.bigchaindb-monit/logs}
|
monit_log_path=${MONIT_LOG_PATH:=$HOME/.bigchaindb-monit/logs}
|
||||||
monit_exec_path=${MONIT_EXEC_PATH:=$HOME/.monitrc}
|
monitrc_path=${MONITRC_PATH:=$HOME/.monitrc}
|
||||||
|
|
||||||
function usage() {
|
function usage() {
|
||||||
cat <<EOM
|
cat <<EOM
|
||||||
@ -36,7 +36,7 @@ function usage() {
|
|||||||
|
|
||||||
ENV[MONIT_EXEC_PATH] || --monit-exec-path PATH
|
ENV[MONIT_EXEC_PATH] || --monit-exec-path PATH
|
||||||
|
|
||||||
Absolute path to the directory to run the script form. (default: ${monit_exec_path})
|
Absolute path to the monit control file(monitrc). (default: ${monitrc_path})
|
||||||
|
|
||||||
-h|--help
|
-h|--help
|
||||||
Show this help and exit.
|
Show this help and exit.
|
||||||
@ -60,7 +60,7 @@ while [[ $# -gt 0 ]]; do
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--monit-exec-path)
|
--monit-exec-path)
|
||||||
monit_exec_path="$2"
|
monitrc_path="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
@ -130,24 +130,24 @@ EOF
|
|||||||
chmod +x ${monit_script_path}
|
chmod +x ${monit_script_path}
|
||||||
|
|
||||||
# Handling overwriting of control file interactively
|
# Handling overwriting of control file interactively
|
||||||
if [ -f "$monit_exec_path" ]; then
|
if [ -f "$monitrc_path" ]; then
|
||||||
echo "$monit_exec_path already exists."
|
echo "$monitrc_path already exists."
|
||||||
read -p "Overwrite[Y]? " -n 1 -r
|
read -p "Overwrite[Y]? " -n 1 -r
|
||||||
echo
|
echo
|
||||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
echo "Overriding $monit_exec_path/.monitrc"
|
echo "Overriding $monitrc_path/.monitrc"
|
||||||
else
|
else
|
||||||
read -p "Enter absolute path to store Monit control file: " monit_exec_path
|
read -p "Enter absolute path to store Monit control file: " monitrc_path
|
||||||
eval monit_exec_path="$monit_exec_path"
|
eval monitrc_path="$monitrc_path"
|
||||||
if [ ! -d "$(dirname $monit_exec_path)" ]; then
|
if [ ! -d "$(dirname $monitrc_path)" ]; then
|
||||||
echo "Failed to save monit control file '$monit_exec_path': No such file or directory."
|
echo "Failed to save monit control file '$monitrc_path': No such file or directory."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# configure monitrc
|
# configure monitrc
|
||||||
cat >${monit_exec_path} <<EOF
|
cat >${monitrc_path} <<EOF
|
||||||
set httpd
|
set httpd
|
||||||
port 2812
|
port 2812
|
||||||
allow localhost
|
allow localhost
|
||||||
@ -167,7 +167,7 @@ check process tendermint
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Setting permissions for control file
|
# Setting permissions for control file
|
||||||
chmod 0700 ${monit_exec_path}
|
chmod 0700 ${monitrc_path}
|
||||||
|
|
||||||
echo -e "BigchainDB process manager configured!"
|
echo -e "BigchainDB process manager configured!"
|
||||||
set -o errexit
|
set -o errexit
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user