From 0f423543cc41078748d1f74604f15543f47a9815 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 6 Jan 2018 19:33:37 +0000 Subject: [PATCH] Minor bugfixes --- cloudcatcher-info.sh | 3 ++- cloudcatcher.sh | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cloudcatcher-info.sh b/cloudcatcher-info.sh index 315d1c7..a84ea11 100755 --- a/cloudcatcher-info.sh +++ b/cloudcatcher-info.sh @@ -9,6 +9,7 @@ # ███████ ███████ ██ ██████ ██ # ############################################# +own_dir="${BASH_SOURCE%/*}/"; tmpdir="$(mktemp --directory --suffix -cloudcatcher)/"; ########################## @@ -65,7 +66,7 @@ uname -r >${tmpdir}kernel-version.txt & # Uptime uptime --pretty | sed -e 's/up //' >${tmpdir}uptime.txt & # Current ips -ip addr show scope global | awk -f ./parse_interface_ips.awk >${tmpdir}ips.txt & +ip addr show scope global | awk -f "${own_dir}/parse_interface_ips.awk" >${tmpdir}ips.txt & # Load cat /proc/loadavg | cut -d' ' -f 2 >${tmpdir}load.txt & diff --git a/cloudcatcher.sh b/cloudcatcher.sh index 9b824f4..afc8530 100755 --- a/cloudcatcher.sh +++ b/cloudcatcher.sh @@ -1,16 +1,19 @@ #!/usr/bin/env bash + ### Settings ### +own_dir="${BASH_SOURCE%/*}/"; + logo_filename="logo.txt"; info_filename=$(mktemp --suffix -cloudcatcher); -if [ -f .cloudcatcher-settings ]; then - source .cloudcatcher-settings; +if [ -f "${own_dir}.cloudcatcher-settings" ]; then + source "${own_dir}.cloudcatcher-settings"; fi ################ -./cloudcatcher-info.sh >${info_filename} +${own_dir}cloudcatcher-info.sh >${info_filename} ### Output ### echo