Initial add of defaria.com
[clearscm.git] / defaria.com / Computers / code / adm / bin / vicron
1 #! /bin/sh
2 # upate the cron entries for the user name who is running this script
3 #
4 # Get info
5 #
6 echo Updating the cron entries for `whoami`
7 TMP="/tmp/$$.`whoami`"
8 TMP2="/tmp/2.$$.`whoami`"
9
10 crontab -l > $TMP
11 cp $TMP $TMP2
12
13 vi $TMP
14
15 echo "Changes made:"
16 if diff $TMP2 $TMP
17 then
18         exit 0
19 fi
20
21 echo "Install this new crontab file for `whoami` (y or n)?  \c"
22
23 while true
24 do
25         read response
26         case $response in
27                 Y | y)  
28                         crontab $TMP
29                         echo "Done."
30                         break
31                         ;;
32
33                 N | n)
34                         /bin/rm -f $TMP $TMP2
35                         exit 0
36                         ;;
37                 Q | q)
38                         /bin/rm -f $TMP $TMP2
39                         exit 0
40                         ;;
41
42                 *)
43                         echo  " Please specify either Y or N. (Type Q to quit.)   \c"
44                         ;;
45         esac
46 done
47
48 /bin/rm -f $TMP $TMP2
49
50 exit 0