#!/bin/sh
# GetMail 0.2
# Copyright (C) 1997  Jonathan Simantov
echo "Welcome to PopDoc!"
echo "This is the one-time configuration script. If you make a mistake, press"
echo "Control-C and try again."
echo
echo -n "What port is your Pilot on (for example /dev/cua1)? "
read PILOTPORT
echo -n "Enter mailserver hostname: "
read PILOTPOPSERVER
echo -n "Enter mailserver username: "
read PILOTPOPUSER
cat << EOF > GetMyMail
#!/bin/sh
# GetMail 0.2
# Copyright (C) 1997  Jonathan Simantov
if popclient -3 -s -k -u $PILOTPOPUSER -c $PILOTPOPSERVER | splitup
then
 echo Making Doc documents...
 makedocs
 rm -rf ..docs 2> /dev/null
 mkdir ..docs
 mv *.prc ..docs
 echo
 echo "Press the HotSync button now."
 pilot-xfer $PILOTPORT -r ..docs >/dev/null
 rm -rf ..docs
 rm mymail.* makedocs
 echo "Done."
else
 rm makedocs
 echo "No mail on server (or bad password)"
fi
EOF
chmod 755 GetMyMail

