]> Pileus Git - ~andy/fetchmail/blob - contrib/logout
Minor bug fixes for socket.c
[~andy/fetchmail] / contrib / logout
1 #       ~/.bash_logout
2 #       Clean things up when I Exit.
3
4 # Below is for Fetchmail clean up
5 #
6 #       TDEV=my PRESENT terminal device IE: ttyp0, tty5, .....
7 #
8 export TDEV=`tty | sed -n -e "s#/dev/##p"`
9 #
10 if [ -s ~/.fetchmail ]; then
11 #
12     if [ -s ~/.fetchmail.$TDEV ]; then
13         TEST=`/usr/bin/grep 'notowner' ~/.fetchmail.$TDEV`
14 #
15         if [ ! -z $TEST ]; then
16             /bin/rm -rf ~/.fetchmail.$TDEV
17         elif [ -z $TEST ]; then
18             /bin/rm -rf ~/.fetchmail.$TDEV
19             /usr/local/bin/fetchmail -q >/dev/null 2>&1
20         fi
21 #
22     else
23         echo "WARNING: A process either did not record a ~/.fetchmail.$TDEV" >> ~/.fetchmail.warning.$TDEV
24         echo "WARNING: Or removed the file manually ." >> ~/.fetchmail.warning.$TDEV
25     fi
26 #
27 else
28     echo "WARNING: parent process has exit'ed & removed primary ~/.fetchmail.$TDEV " >> ~/.fetchmail.warning.$TDEV
29 fi
30 # END of Fetchmail clean up