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