Codebase list metche / e1a798c
Added optional command line parameter (-h) to specify an alternative config file. intrigeri 18 years ago
1 changed file(s) with 30 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
6565
6666 "
6767
68 if [ -f /etc/metche.conf ]; then
69 . /etc/metche.conf
68 function display_usage {
69 ( echo "Usage: $0 [-h HOST] list"
70 echo " $0 [-h HOST] report [milestone]"
71 echo " $0 [-h HOST] cron"
72 echo "If -h is specified, /etc/metche/HOST.conf is used instead of /etc/metche.conf and"
73 echo "./metche.conf, which are tried in this order before falling back to the hardcoded"
74 echo "defaults."
75 ) >&2
76 }
77
78 if [ "x$1" == "x-h" ]; then
79 if [ -f /etc/metche/$2.conf ]; then
80 . /etc/metche/$2.conf
81 CMD="$3"
82 MILESTONE="$4"
83 else
84 display_usage
85 exit 1
86 fi
7087 else
71 . metche.conf
88 if [ -f /etc/metche.conf ]; then
89 . /etc/metche.conf
90 elif [ -f metche.conf ]; then
91 . metche.conf
92 fi
93 CMD="$1"
94 MILESTONE="$2"
7295 fi
7396
7497 PATH="/bin:/usr/bin"
207230 save_state "testing"
208231 fi
209232
210 case "$1" in
233 case "$CMD" in
211234 report)
212 if [ "x$2" == "x" ]; then
235 if [ "x$MILESTONE" == "x" ]; then
213236 report_changes "testing-latest"
214237 else
215 report_changes "testing-$2"
238 report_changes "testing-$MILESTONE"
216239 fi
217240 exit 0
218241 ;;
251274 fi
252275 ;;
253276 *)
254 (echo "Usage: $0 list"
255 echo " $0 report [milestone]"
256 echo " $0 cron"
257 ) >&2
277 display_usage
258278 exit 1
259279 ;;
260280 esac