This commit is contained in:
Eliezer Croitoru 2024-03-31 23:36:10 +03:00
parent 752a38cb84
commit 09ebb5c0f4

View File

@ -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