Changeset 1226 for dass-tools/usr/bin


Ignore:
Timestamp:
Nov 29, 2016, 12:51:52 PM (8 years ago)
Author:
joergs
Message:

display usage also when called with options (like --help)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dass-tools/usr/bin/reposync-add-repo.sh

    r1215 r1226  
    77set -o errexit -o nounset
    88
     9DEST=""
    910if [ -r /etc/dass-it/reposync.conf ]; then
    1011   source /etc/dass-it/reposync.conf
     
    2728   local URL="$1"
    2829   [ -z "$1" ] && return 1
    29    local CODE=`curl --location --write-out %{http_code} --silent --output /dev/null "$URL"`
     30   local CODE=`curl --location --write-out %{http_code} --silent --output /dev/null -- "$URL"`
    3031   printf "  %s: %s\n" "$URL" "$CODE"
    3132   test "$CODE" = "200"
     
    3637STARTDIR=${2:-$DEST}
    3738
    38 if ! [ -d $STARTDIR ]; then
     39if [[ $REPO_FILE_URL == -* ]]; then
     40  usage
     41  exit 0
     42fi
     43
     44if ! [ -d "$STARTDIR" ]; then
    3945  echo "FAILED: $STARTDIR is not a valid directory."
    4046  usage
Note: See TracChangeset for help on using the changeset viewer.