Fix false path
This commit is contained in:
parent
52e05aae33
commit
49f4b71bcd
7 changed files with 26 additions and 21 deletions
|
@ -90,7 +90,7 @@ source_config() {
|
|||
local configFallback=$2;
|
||||
|
||||
if [[ ! -f "$config" ]]; then
|
||||
if [[ ! -f "$backupConfigFileFallback" ]]; then
|
||||
if [[ ! -f "$configFallback" ]]; then
|
||||
echo "No config file specified and could not find default in '$configFallback'!";
|
||||
echo "";
|
||||
usage;
|
||||
|
|
|
@ -32,7 +32,7 @@ source_config() {
|
|||
local configFallback=$2;
|
||||
|
||||
if [[ ! -f "$config" ]]; then
|
||||
if [[ ! -f "$backupConfigFileFallback" ]]; then
|
||||
if [[ ! -f "$configFallback" ]]; then
|
||||
echo "No config file specified and could not find default in '$configFallback'!";
|
||||
echo "";
|
||||
usage;
|
||||
|
|
|
@ -36,7 +36,7 @@ source_config() {
|
|||
local configFallback=$2;
|
||||
|
||||
if [[ ! -f "$config" ]]; then
|
||||
if [[ ! -f "$backupConfigFileFallback" ]]; then
|
||||
if [[ ! -f "$configFallback" ]]; then
|
||||
echo "No config file specified and could not find default in '$configFallback'!";
|
||||
echo "";
|
||||
usage;
|
||||
|
|
|
@ -37,7 +37,7 @@ source_config() {
|
|||
local configFallback=$2;
|
||||
|
||||
if [[ ! -f "$config" ]]; then
|
||||
if [[ ! -f "$backupConfigFileFallback" ]]; then
|
||||
if [[ ! -f "$configFallback" ]]; then
|
||||
echo "No config file specified and could not find default in '$configFallback'!";
|
||||
echo "";
|
||||
usage;
|
||||
|
|
|
@ -35,7 +35,7 @@ source_config() {
|
|||
local configFallback=$2;
|
||||
|
||||
if [[ ! -f "$config" ]]; then
|
||||
if [[ ! -f "$backupConfigFileFallback" ]]; then
|
||||
if [[ ! -f "$configFallback" ]]; then
|
||||
echo "No config file specified and could not find default in '$configFallback'!";
|
||||
echo "";
|
||||
usage;
|
||||
|
|
|
@ -32,7 +32,7 @@ source_config() {
|
|||
local configFallback=$2;
|
||||
|
||||
if [[ ! -f "$config" ]]; then
|
||||
if [[ ! -f "$backupConfigFileFallback" ]]; then
|
||||
if [[ ! -f "$configFallback" ]]; then
|
||||
echo "No config file specified and could not find default in '$configFallback'!";
|
||||
echo "";
|
||||
usage;
|
||||
|
|
|
@ -36,26 +36,31 @@ SYSTEMD_CHECK_USER=$(whoami)
|
|||
SYSTEMD_CHECK_SERVICES=()
|
||||
|
||||
# check for config file
|
||||
systemdCheckConfigFile=$1;
|
||||
systemdCheckConfigFileFallback=$HOME/.systemd_check.conf;
|
||||
source_config() {
|
||||
local config=$1;
|
||||
local configFallback=$2;
|
||||
|
||||
if [[ ! -f "$systemdCheckConfigFile" ]]; then
|
||||
if [[ ! -f "$systemdCheckConfigFileFallback" ]]; then
|
||||
echo "No config file specified and could not find default in '$systemdCheckConfigFileFallback'!";
|
||||
echo "";
|
||||
usage;
|
||||
exit 1;
|
||||
else
|
||||
systemdCheckConfigFile=$systemdCheckConfigFileFallback;
|
||||
fi
|
||||
fi
|
||||
if [[ ! -f "$config" ]]; then
|
||||
if [[ ! -f "$configFallback" ]]; then
|
||||
echo "No config file specified and could not find default in '$configFallback'!";
|
||||
echo "";
|
||||
usage;
|
||||
exit 1;
|
||||
else
|
||||
config=$configFallback;
|
||||
fi
|
||||
fi
|
||||
|
||||
set -a;
|
||||
source "$systemdCheckConfigFile";
|
||||
set +a;
|
||||
set -a;
|
||||
source "$config";
|
||||
set +a;
|
||||
}
|
||||
source_config "$1" "$HOME/.systemd_check.conf"
|
||||
|
||||
if [ ! -f $SYSTEMD_CHECK_LIST_FILE ]; then
|
||||
echo "$SYSTEMD_CHECK_LIST_FILE doesn't exist. Add a file which holds one systemd service or timer per line.";
|
||||
echo "";
|
||||
usage;
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue