#!/bin/sh usage="Usage \"$0 [-l lockername] crontab\"" while getopts "l:h" options; do case $options in l ) lname=$OPTARG;; h ) echo "$usage"; exit 0;; \? ) echo "$usage" exit 1;; * ) echo "$usage" exit 1;; esac done shift `expr $OPTIND - 1` if [ -z "$1" ]; then echo "$usage" exit 1 fi echo "This program should print your new crontab below." echo "If it does not do so, something is wrong." echo "Feel free to contact scripts@mit.edu for assistance." echo cwd=`pwd` if [ -z "$lname" ]; then lname=`perl -e "\\\$temp = \"$cwd\"; \\\$temp =~ /\\\/([^\\\/]+)\\\/cron_scripts/; print \\\$1"` fi if [ -z "$lname" ]; then echo "ERROR: Could not detect locker name. Make sure to run" echo "cronload from within /mit/lockername/cron_scripts/" echo "(or pass the -l lockername option)" exit 1 fi athrun scripts scripts-ssh "$lname" /usr/local/bin/cronload "$1" "$cwd" 2>/dev/null