-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path_core.sh
executable file
·39 lines (37 loc) · 1016 Bytes
/
_core.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Variables
API_URL="http://192.168.255.5:8085/api/v3/jobs/push"
AUTH_TOKEN="${AUTH_TOKEN}"
TAG_UUID="b541b2fe-1f65-4cfb-b830-d606d0a732ae"
COMMAND1="config replace tftp://172.18.0.2/config_file_core_switch force"
COMMAND2="write memory"
USERNAME="string"
PASSWORD="string"
ENABLE_PASSWORD="string"
CONFIGURE_PASSWORD="string"
# Curl command
curl -X 'POST' ${API_URL} \
-H 'accept: application/json' \
-H "Authorization: ${AUTH_TOKEN}" \
-H 'Content-Type: application/json' \
-d "{
\"commands\": [
\"${COMMAND1}\",
\"${COMMAND2}\"
],
\"requireEnableMode\": true,
\"requireConfigureMode\": false,
\"tagUuids\": [
\"${TAG_UUID}\"
],
\"advancedSettings\": {
\"promptMatchingModeEnum\": \"LEARNING\",
\"overrideTimeouts\": false,
\"timeout\": 0,
\"overrideCredentials\": false,
\"username\": \"${USERNAME}\",
\"password\": \"${PASSWORD}\",
\"enablePassword\": \"${ENABLE_PASSWORD}\",
\"configurePassword\": \"${CONFIGURE_PASSWORD}\"
}
}"