diff --git a/bandwidth2/bandwidth2.c b/bandwidth2/bandwidth2.c index d354b4ba..b4a43ff5 100644 --- a/bandwidth2/bandwidth2.c +++ b/bandwidth2/bandwidth2.c @@ -6,8 +6,8 @@ #include #include -#define RED "#FF7373" -#define ORANGE "#FFA500" +char RED[] = "#FF7373"; +char ORANGE[] = "#FFA500"; typedef unsigned long long int ulli; @@ -82,11 +82,14 @@ void display(int const unit, int const divisor, double b, int const warning, int const critical) { char fmtstr[7]; + char* envvar; if (critical != 0 && b > critical) { - printf("", RED); + envvar = getenv("RED"); + printf("", envvar ? envvar : RED); } else if (warning != 0 && b > warning) { - printf("", ORANGE); + envvar = getenv("ORANGE"); + printf("", envvar ? envvar : ORANGE); } else { printf(""); }