1 |
On Tuesday 26 June 2007 08:54:39, "Gentoo Voyager" <gentoovoyager@×××××.com> |
2 |
wrote : |
3 |
> Dear all, |
4 |
> how to send automatic mail while halting the gentoo system. qmail server |
5 |
> running on my gentoo box. |
6 |
Maybe you can add a rc script to send an email at shutdown. |
7 |
For example : |
8 |
===============/etc/init.d/notifyhalt======================== |
9 |
#!/sbin/runscript |
10 |
|
11 |
EMAIL="root@××××××.net" |
12 |
|
13 |
depend () { |
14 |
need net |
15 |
} |
16 |
|
17 |
start () { |
18 |
return |
19 |
} |
20 |
|
21 |
stop () { |
22 |
ebegin "Notifying $EMAIL of rebooting the system" |
23 |
cat <<EOF | sendmail $EMAIL |
24 |
From: halt.notify@××××××.net |
25 |
Subject: System reboot |
26 |
|
27 |
The system is rebooting ! |
28 |
EOF |
29 |
eend $? |
30 |
} |
31 |
=================================================== |
32 |
Add it by rc-update add notifyhalt default |
33 |
Hope this can help ! |
34 |
> |
35 |
> Thanks, |
36 |
|
37 |
|
38 |
Regards, |
39 |
Xavier Parizet |
40 |
|
41 |
-- |
42 |
http://www.linuxant.fr |