2
This commit is contained in:
parent
752a38cb84
commit
09ebb5c0f4
@ -2,7 +2,6 @@
|
||||
|
||||
DEBUG="0"
|
||||
|
||||
set -x
|
||||
ROUTEROS_HOST="$1"
|
||||
USERNAME="$2"
|
||||
PASSWORD="$3"
|
||||
@ -14,6 +13,11 @@ SCRIPT_FILENAME="$5"
|
||||
if [ ! -z "${SCRIPT_NAME}" ]
|
||||
then
|
||||
|
||||
if [ ! -f "${SCRIPT_FILENAME}" ]
|
||||
then
|
||||
echo "The file [ \"${SCRIPT_FILENMAE}\" ] is missing" >&2
|
||||
exit 1
|
||||
fi
|
||||
DATA=$( ruby text-file-to-json.rb ${SCRIPT_NAME} ${SCRIPT_FILENAME} )
|
||||
ADD_RES=$(\
|
||||
curl -q -k -u ${USERNAME}:${PASSWORD} -X POST "https://${ROUTEROS_HOST}/rest/system/script/add" \
|
||||
@ -22,6 +26,3 @@ curl -q -k -u ${USERNAME}:${PASSWORD} -X POST "https://${ROUTEROS_HOST}/rest/sys
|
||||
)
|
||||
echo "${ADD_RES}"
|
||||
fi
|
||||
|
||||
|
||||
set +x
|
||||
|
Loading…
Reference in New Issue
Block a user