diff options
author | ncopa <ncopa@f176ef85-8d20-0410-844a-e957b5a1c371> | 2008-04-14 12:12:38 +0000 |
---|---|---|
committer | ncopa <ncopa@f176ef85-8d20-0410-844a-e957b5a1c371> | 2008-04-14 12:12:38 +0000 |
commit | 3a71aa3308d05f8896d0722ae49f3daf7311598c (patch) | |
tree | beb445fbc728cebb8f2cb7cb4e19bc808989ba76 | |
parent | 924f60fb1f762574a1c82d175d8e07b6b81557b8 (diff) | |
download | alpine-baselayout-3a71aa3308d05f8896d0722ae49f3daf7311598c.tar.bz2 alpine-baselayout-3a71aa3308d05f8896d0722ae49f3daf7311598c.tar.xz |
check that sendmail exist
-rw-r--r-- | src/sendbug.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sendbug.c b/src/sendbug.c index abe6aad..f9fe290 100644 --- a/src/sendbug.c +++ b/src/sendbug.c @@ -31,6 +31,9 @@ #ifndef _PATH_DMESG #define _PATH_DMESG "/var/log/dmesg" #endif +#ifndef _PATH_SENDMAIL +#define _PATH_SENDMAIL "/usr/sbin/sendmail" +#endif #define _DEFAULT_CONFIG "/etc/sendbug/sendbug.conf" int checkfile(const char *); @@ -96,6 +99,12 @@ main(int argc, char *argv[]) time_t mtime; FILE *fp; + if (access(_PATH_SENDMAIL, R_OK | X_OK) == -1) { + warn("sendmail"); + fprintf(stderr, "Please run 'setup-sendbug' to configure sendbug\n"); + return ret; + } + config_file = NULL; while ((ch = getopt(argc, argv, "a:c:dLPV")) != -1) switch (ch) { |