Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Informatica Secure Agent
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
interop
iics
Informatica Secure Agent
Commits
f9d7bb44
Commit
f9d7bb44
authored
5 years ago
by
Eric Schoville
Browse files
Options
Downloads
Patches
Plain Diff
Update run_agent.sh
parent
32e6ce60
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
run_agent.sh
+20
-30
20 additions, 30 deletions
run_agent.sh
with
20 additions
and
30 deletions
run_agent.sh
+
20
−
30
View file @
f9d7bb44
...
@@ -102,8 +102,6 @@ ic_session_id=${result[1]}
...
@@ -102,8 +102,6 @@ ic_session_id=${result[1]}
if
[
-z
${
server_url
+x
}
]
;
then
if
[
-z
${
server_url
+x
}
]
;
then
echo
"No Server URL set"
echo
"No Server URL set"
exit
1
exit
1
else
echo
"Server URL:
${
server_url
}
"
fi
fi
if
[
-z
${
ic_session_id
+x
}
]
;
then
if
[
-z
${
ic_session_id
+x
}
]
;
then
...
@@ -111,47 +109,39 @@ if [ -z ${ic_session_id+x} ]; then
...
@@ -111,47 +109,39 @@ if [ -z ${ic_session_id+x} ]; then
exit
1
exit
1
fi
fi
# Check for the existance of infaagent.ini and see if it has been registered.
# Check for the existance of infaagent.ini and see if it has been registered.
register
=
true
register
=
true
config_file
=
"conf/infaagent.ini"
agent_id
=
$(
grep
-oPs
'^InfaAgent.Id=\K.+'
conf/infaagent.ini
)
if
[
-e
"
$config_file
"
]
;
then
echo
"Found infaagent.ini"
agent_id
=
$(
grep
-oP
'^InfaAgent.Id=\K.+'
$config_file
)
# Use expansion to check for null
if
[
-n
"
${
agent_id
+x
}
"
]
;
then
# Check the registered agent ID to see if it is running or not.
if
[
-z
"
${
agent_id
}
"
]
;
then
# active seems to be set to true if it has been running recently
echo
"No agent id found, registering new agent"
# readyToRun means it is up and running
else
result
=(
$(
curl
-sS
-H
"Content-Type: application/json"
\
-H
"Accept: application/json"
\
-H
"icSessionId:
${
ic_session_id
}
"
\
"
${
server_url
}
/api/v2/agent/
${
agent_id
}
"
| jq
-r
'.active, .readyToRun, .name'
)
)
if
[
-z
"
${
result
[0]
}
"
]
;
then
echo
"Unable to find agent_id, registering a new agent"
# If we find an agent_id, then query the Informatica API and
# check the registered agent ID to see if it is running or not.
# active seems to be set to true if it has been running recently
# readyToRun means it is up and running
elif
[[
"
${
result
[0]
}
"
=
"true"
&&
"
${
result
[1]
}
"
=
"true"
]]
;
then
echo
"Checking the status of
${
agent_id
}
using the agent API"
echo
"Already exists a running agent with the id of
${
agent_id
}
:
${
result
[1]
}
, registering a new agent"
result
=(
$(
curl
-sS
-H
"Content-Type: application/json"
\
-H
"Accept: application/json"
\
-H
"icSessionId:
${
ic_session_id
}
"
\
"
${
server_url
}
/api/v2/agent/
${
agent_id
}
"
| jq
-r
'.active, .readyToRun, .name'
)
)
else
if
[
-z
"
${
result
[0]
}
"
]
;
then
#Not running, but exists. This should be the default condition, in which case we would just run the agent
echo
"Unable to find agent_id, registering a new agent"
register
=
false
fi
elif
[[
"
${
result
[0]
}
"
=
"true"
&&
"
${
result
[1]
}
"
=
"true"
]]
;
then
echo
"Already exists a running agent with the id of
${
agent_id
}
, registering a new agent"
else
else
echo
"This looks to be a new agent, registering new agent"
#Not running, but exists. This should be the default condition, in which case we would just run the agent
register
=
false
fi
fi
fi
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment