2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/tools/munin-plugins-busybox/common.c

24 lines
337 B
C
Raw Normal View History

2008-06-21 13:33:06 +02:00
#include <stdio.h>
2013-01-28 16:35:25 +01:00
#include <stdlib.h>
2008-06-21 13:33:06 +02:00
int writeyes(void) {
puts("yes");
return 0;
}
int writeno(const char *s) {
if(s)
printf("no (%s)\n", s);
else
puts("no");
return 1;
}
2013-01-28 16:35:25 +01:00
int getenvint(const char *name, int defvalue) {
const char *value;
value = getenv(name);
if(value == NULL)
return defvalue;
return atoi(value);
}