Fix false path

This commit is contained in:
Alexander Schäferdiek 2019-01-25 19:02:33 +01:00
parent 52e05aae33
commit 49f4b71bcd
7 changed files with 26 additions and 21 deletions

View file

@ -90,7 +90,7 @@ source_config() {
local configFallback=$2; local configFallback=$2;
if [[ ! -f "$config" ]]; then 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 "No config file specified and could not find default in '$configFallback'!";
echo ""; echo "";
usage; usage;

View file

@ -32,7 +32,7 @@ source_config() {
local configFallback=$2; local configFallback=$2;
if [[ ! -f "$config" ]]; then 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 "No config file specified and could not find default in '$configFallback'!";
echo ""; echo "";
usage; usage;

View file

@ -36,7 +36,7 @@ source_config() {
local configFallback=$2; local configFallback=$2;
if [[ ! -f "$config" ]]; then 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 "No config file specified and could not find default in '$configFallback'!";
echo ""; echo "";
usage; usage;

View file

@ -37,7 +37,7 @@ source_config() {
local configFallback=$2; local configFallback=$2;
if [[ ! -f "$config" ]]; then 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 "No config file specified and could not find default in '$configFallback'!";
echo ""; echo "";
usage; usage;

View file

@ -35,7 +35,7 @@ source_config() {
local configFallback=$2; local configFallback=$2;
if [[ ! -f "$config" ]]; then 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 "No config file specified and could not find default in '$configFallback'!";
echo ""; echo "";
usage; usage;

View file

@ -32,7 +32,7 @@ source_config() {
local configFallback=$2; local configFallback=$2;
if [[ ! -f "$config" ]]; then 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 "No config file specified and could not find default in '$configFallback'!";
echo ""; echo "";
usage; usage;

View file

@ -36,26 +36,31 @@ SYSTEMD_CHECK_USER=$(whoami)
SYSTEMD_CHECK_SERVICES=() SYSTEMD_CHECK_SERVICES=()
# check for config file # check for config file
systemdCheckConfigFile=$1; source_config() {
systemdCheckConfigFileFallback=$HOME/.systemd_check.conf; local config=$1;
local configFallback=$2;
if [[ ! -f "$systemdCheckConfigFile" ]]; then if [[ ! -f "$config" ]]; then
if [[ ! -f "$systemdCheckConfigFileFallback" ]]; then if [[ ! -f "$configFallback" ]]; then
echo "No config file specified and could not find default in '$systemdCheckConfigFileFallback'!"; echo "No config file specified and could not find default in '$configFallback'!";
echo ""; echo "";
usage; usage;
exit 1; exit 1;
else else
systemdCheckConfigFile=$systemdCheckConfigFileFallback; config=$configFallback;
fi fi
fi fi
set -a; set -a;
source "$systemdCheckConfigFile"; source "$config";
set +a; set +a;
}
source_config "$1" "$HOME/.systemd_check.conf"
if [ ! -f $SYSTEMD_CHECK_LIST_FILE ]; then 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 "$SYSTEMD_CHECK_LIST_FILE doesn't exist. Add a file which holds one systemd service or timer per line.";
echo "";
usage;
exit 1; exit 1;
fi fi