2 # Clean things up when I Exit.
4 # Below is for Fetchmail clean up
6 # TDEV=my PRESENT terminal device IE: ttyp0, tty5, .....
8 export TDEV=`tty | sed -n -e "s#/dev/##p"`
10 if [ -s ~/.fetchmail ]; then
12 if [ -s ~/.fetchmail.$TDEV ]; then
13 TEST=`/usr/bin/grep 'notowner' ~/.fetchmail.$TDEV`
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
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
28 echo "WARNING: parent process has exit'ed & removed primary ~/.fetchmail.$TDEV " >> ~/.fetchmail.warning.$TDEV
30 # END of Fetchmail clean up