#!/bin/sh # Since vacation on the linux side is not interactive, created this script to # mimic the way the vacation script works on the solaris side USERNAME=`whoami` echo "This program can be used to answer your mail automatically when you go away on vacation." if [ ! -f $HOME/.vacation.msg ]; then echo "Subject: away from my mail" > $HOME/.vacation.msg echo "" >> $HOME/.vacation.msg echo "I will not be reading my mail for awhile." >> $HOME/.vacation.msg echo "Your mail regarding "$SUBJECT" will be read when I return." >> $HOME/.vacation.msg vi $HOME/.vacation.msg fi if [ -f $HOME/.vacation.msg ]; then echo "You have a message file in $HOME/.vacation.msg." echo "Would you like to see it?" read line case "$line" in [Yy]|[Yy][Ee][Ss]) cat $HOME/.vacation.msg;; [Nn]|[Nn][Oo]) ;; *) echo "Command not understood" exit 1;; esac echo "Would you like to edit it?" read line case "$line" in [Yy]|[Yy][Ee][Ss]) vi $HOME/.vacation.msg;; [Nn]|[Nn][Oo]) ;; *) echo "Command not understood" exit 1;; esac echo "To enable the vacation feature a ".forward" file is created." echo "Would you like to enable the vacation feature?" read line case "$line" in [Yy]|[Yy][Ee][Ss]) if [ -f $HOME/.forward ]; then mv $HOME/.forward $HOME/.forward.orig fi echo "\\$USERNAME, \"|/usr/bin/vacation $USERNAME\"" > $HOME/.forward echo "Vacation feature ENABLED. Please remember to turn it off" echo "when you get back from vacation. Bon voyage.";; [Nn]|[Nn][Oo]) if [ -f $HOME/.forward ]; then echo "You have a .forward file in your home directory containing:" cat $HOME/.forward echo "Would you like to remove it and disable the vacation feature?" read line case "$line" in [Yy]|[Yy][Ee][Ss]) rm $HOME/.forward echo "Back to normal reception of mail";; [Nn]|[Nn][Oo]) ;; *) echo "Command not understood" exit 1;; esac else echo "OK, vacation feature NOT enabled." fi ;; *) echo "Command not understood" exit 1;; esac fi