Lines 6-29
Link Here
|
6 |
} |
6 |
} |
7 |
|
7 |
|
8 |
checkconfig() { |
8 |
checkconfig() { |
9 |
if [ ! -f /etc/fetchmailrc ]; then |
9 |
if [ ! -h /etc/fetchmailrc ]; then |
10 |
eerror "Configuration file /etc/fetchmailrc not found" |
10 |
ln -fs /var/lib/fetchmail/fetchmailrc /etc/fetchmailrc |
11 |
return 1 |
11 |
ewarn "Configuration symlink /etc/fetchmailrc not found - created" |
12 |
fi |
12 |
fi |
|
|
13 |
if [ ! -f /var/lib/fetchmail/fetchmailrc ]; then |
14 |
eerror "Configuration file /var/lib/fetchmail/fetchmailrc not found" |
15 |
return 1 |
16 |
fi |
13 |
} |
17 |
} |
14 |
|
18 |
|
15 |
start() { |
19 |
start() { |
16 |
checkconfig || return 1 |
20 |
checkconfig || return 1 |
17 |
|
21 |
|
18 |
ebegin "Starting fetchmail" |
22 |
ebegin "Starting fetchmail" |
19 |
start-stop-daemon --start --chuid mail --quiet --exec /usr/bin/fetchmail \ |
23 |
start-stop-daemon --start --quiet \ |
20 |
-- -d ${polling_period} -f /etc/fetchmailrc |
24 |
--chuid fetchmail --exec /usr/bin/fetchmail \ |
|
|
25 |
-- -d ${polling_period} -f /var/lib/fetchmail/fetchmailrc |
21 |
eend ${?} |
26 |
eend ${?} |
22 |
} |
27 |
} |
23 |
|
28 |
|
24 |
stop() { |
29 |
stop() { |
25 |
ebegin "Stopping fetchmail" |
30 |
ebegin "Stopping fetchmail" |
26 |
start-stop-daemon --stop --quiet --pidfile /var/run/fetchmail.pid |
31 |
start-stop-daemon --stop --quiet \ |
|
|
32 |
--pidfile /var/run/fetchmail/fetchmail.pid |
27 |
eend ${?} |
33 |
eend ${?} |
28 |
} |
34 |
} |
29 |
|
35 |
|