MODE=""
DOMAIN_LIST=""
SOFTWARE_LIST=""
+TEMP_FILE="${TMP}/domains.txt"
if [ "$1" = "--help" ]
then
- echo "Usage: $0 [file|--software|--nodeinfo|--generator|--timeout|--same]"
+ echo "Usage: $0 [file|--software|--nodeinfo|--generator|--timeout|--same] [--any|--remove]"
+ echo ""
+ echo "--any : Any parameter that is being handled to fba.py, e.g. --force is common."
+ echo "--remove : Removes each successfully handled entry from provided file (if provided)."
exit 255
elif [ -n "$1" -a -f "$1" ]
then
echo "$0: DOMAIN='${DOMAIN}'"
if [ -n "$1" -a -z "${MODE}" ]
then
+ echo "$0: Parameter 1='$1' ..."
./fba.py update_nodeinfo --domain="${DOMAIN}" "$1"
- elif [ -n "$2" ]
+ STATUS="$?"
+ elif [ -n "$2" -a "$2" != "--remove" ]
then
+ echo "$0: Parameter 2='$2' ..."
./fba.py update_nodeinfo --domain="${DOMAIN}" "$2"
+ STATUS="$?"
+ elif [ "$2" = "--remove" -a -n "$3" ]
+ then
+ echo "$0: Parameter 3='$3' ..."
+ ./fba.py update_nodeinfo --domain="${DOMAIN}" "$3"
+ STATUS="$?"
else
+ echo "$0: No special parameter ..."
./fba.py update_nodeinfo --domain="${DOMAIN}"
+ STATUS="$?"
+ fi
+ echo "$0: STATUS='${STATUS}'"
+ if [ "${STATUS}" = "0" -a "$2" = "--remove" -a "${MODE}" = "file" ]
+ then
+ echo "$0: Removing DOMAIN='${DOMAIN}' from file '$1' ..."
+ grep -v "${DOMAIN}" "$1" > "${TEMP_FILE}"
+ mv -v "${TEMP_FILE}" "$1"
fi
done
elif [ -n "${SOFTWARE_LIST}" ]
if [ -n "$2" ]
then
./fba.py update_nodeinfo --software="${SOFTWARE}" "$2"
+ STATUS="$?"
else
./fba.py update_nodeinfo --software="${SOFTWARE}"
+ STATUS="$?"
fi
+ echo "$0: STATUS='${STATUS}'"
done
fi