Changeset 1563 for branches/locker-dev


Ignore:
Timestamp:
May 24, 2010, 10:35:32 PM (14 years ago)
Author:
adehnert
Message:
Be saner about finding lockername in cronload
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/locker-dev/locker/bin/cronload

    r463 r1563  
    11#!/bin/sh
     2
     3usage="Usage \"$0 [-l lockername] crontab\""
     4while getopts "l:h" options; do
     5    case $options in
     6        l ) lname=$OPTARG;;
     7        h ) echo "$usage"; exit 0;;
     8        \? ) echo "$usage"
     9            exit 1;;
     10        * ) echo "$usage"
     11            exit 1;;
     12    esac
     13done
     14shift `expr $OPTIND - 1`
     15if [ -z "$1" ]; then
     16    echo "$usage"
     17    exit 1
     18fi
    219
    320echo "This program should print your new crontab below."
     
    623echo
    724
     25
    826cwd=`pwd`
    9 lname=`perl -e "\\\$temp = \"$cwd\"; \\\$temp =~ /\\\/([^\\\/]+)\\\/cron_scripts/; print \\\$1"`
     27if [ -z "$lname" ]; then
     28    lname=`perl -e "\\\$temp = \"$cwd\"; \\\$temp =~ /\\\/([^\\\/]+)\\\/cron_scripts/; print \\\$1"`
     29fi
     30if [ -z "$lname" ]; then
     31    echo "ERROR: Could not detect locker name. Make sure to run"
     32    echo "cronload from within /mit/lockername/cron_scripts/"
     33    echo "(or pass the -l lockername option)"
     34    exit 1
     35fi
    1036athrun scripts scripts-ssh "$lname" /usr/local/bin/cronload "$1" "$cwd" 2>/dev/null
Note: See TracChangeset for help on using the changeset viewer.