Skip to content
Snippets Groups Projects
Commit f35bbe18 authored by arthur.yueh's avatar arthur.yueh
Browse files

Make the execute-path better used for last PR

parent 8aa6a3f0
No related branches found
No related tags found
No related merge requests found
...@@ -4,12 +4,12 @@ set -e ...@@ -4,12 +4,12 @@ set -e
trap 'echo -ne "\n:::\n:::\tCaught signal, exiting at line $LINENO, while running :${BASH_COMMAND}:\n:::\n"; exit' SIGINT SIGQUIT trap 'echo -ne "\n:::\n:::\tCaught signal, exiting at line $LINENO, while running :${BASH_COMMAND}:\n:::\n"; exit' SIGINT SIGQUIT
current_path=$(pwd) current_path=$(dirname "$0")
settings_file="${1:-grafanaSettings}" settings_file="${1:-grafanaSettings}"
backup_dir="_OUTPUT_" backup_dir="_OUTPUT_"
timestamp=$(date +"%Y-%m-%dT%H-%M-%S") timestamp=$(date +"%Y-%m-%dT%H-%M-%S")
if [[ ! -f "conf/${settings_file}" ]]; then if [[ ! -f "${current_path}/src/conf/${settings_file}.py" ]]; then
echo "Usage:" echo "Usage:"
echo "\t$0 <settings_file>" echo "\t$0 <settings_file>"
echo "\te.g. $1 'grafanaSettings'" echo "\te.g. $1 'grafanaSettings'"
......
...@@ -4,15 +4,15 @@ set -e ...@@ -4,15 +4,15 @@ set -e
trap 'echo -ne "\n:::\n:::\tCaught signal, exiting at line $LINENO, while running :${BASH_COMMAND}:\n:::\n"; exit' SIGINT SIGQUIT trap 'echo -ne "\n:::\n:::\tCaught signal, exiting at line $LINENO, while running :${BASH_COMMAND}:\n:::\n"; exit' SIGINT SIGQUIT
current_path=$(pwd) current_path=$(dirname "$0")
archive_file="$1" archive_file="$1"
settings_file="${2:-grafanaSettings}" settings_file="${2:-grafanaSettings}"
if [[ ! -f "${archive_file}" || ! -f "conf/${settings_file}" ]]; then if [[ ! -f "${archive_file}" || ! -f "${current_path}/src/conf/${settings_file}.py" ]]; then
echo "Usage:" echo "Usage:"
echo "\t$0 <archive_file>" echo "\t$0 <archive_file>"
echo "\te.g. $0 '_OUTPUT_/2019-05-13T11-04-33.tar.gz'" echo "\te.g. $0 '_OUTPUT_/2019-05-13T11-04-33.tar.gz'"
echo "\t$1 <settings_file>" echo "\t$1 <settings_file_name>"
echo "\te.g. $1 'grafanaSettings'" echo "\te.g. $1 'grafanaSettings'"
exit 1 exit 1
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment