aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/start_dynamic_ppp
blob: 7ceeddb321cd846a8d6278d9322147309c37342d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
# setup hostname in /etc/hosts.  use IP if no name available.
echo cyberhq > /tmp/local_name
echo $4 > /tmp/ip
host $4 | fgrep Name | cut -c7- > /tmp/ip_name
if [ ! -s /tmp/ip_name ]; then
    echo $4 > /tmp/ip_name
fi
cat /tmp/ip_name > /etc/sendmail.cw
paste /tmp/ip /tmp/ip_name /tmp/local_name > /tmp/host_bottom
cat /etc/hosts.top /tmp/host_bottom > /etc/hosts
rm /tmp/ip /tmp/ip_name /tmp/host_bottom /tmp/local_name
# Restart sendmail with new name.
kill -HUP `head -1 /var/run/sendmail.pid`
# Start fetchmail as root to fetch our mail.
fetchmail
must change the path given. # # If you have any changes/corrections in the script, please send me email. #------------------------------------------------------------------------------ #!/bin/sh case "$1" in start) sendmail -q date +%d.%m.%Y\ %H:%M:%S\ fetchmail\ started >> /var/log/fetchmail.log fetchmail -d 1 -L /var/log/fetchmail.log & tail -f /var/log/fetchmail.log ;; stop) fetchmail -q date +%d.%m.%Y\ %H:%M:%S\ fetchmail\ stoped >> /var/log/fetchmail.log ;; fetch) date +%d.%m.%Y\ %H:%M:%S\ fetchmail\ started >> /var/log/fetchmail.log fetchmail -d 1 -L /var/log/fetchmail.log & tail -f /var/log/fetchmail.log ;; status) tail -f /var/log/fetchmail.log ;; got) /usr/local/gotmail/gotmail ;; goth) /usr/local/gotmail/gotmail html ;; send) /sendmail -q ;; clear) fetchmail -q rm /var/log/fetchmail.log ;; -v) echo 'getmail version: 0.0.1' ;; *) echo echo 'Usage: getmail option' echo echo 'options:' echo ' clear - stops fetchmail and kills the logfile' echo ' fetch - starts fetchmail' echo ' got - starts gotmail' echo ' goth - starts gotmail html' echo ' send - sends all mail from the mailqueue' echo ' status - tails the logfile' echo ' start - starts fetchmail and tails the logfile' echo ' stop - stops fetchmail' echo ' -v - print the version number' echo esac