Compare commits
1 commit
ab1a43da35
...
8f193eb40b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f193eb40b |
1 changed files with 4 additions and 1 deletions
|
|
@ -2745,7 +2745,10 @@ disinto_hire_an_agent() {
|
||||||
else
|
else
|
||||||
# Store token in .env under the role-specific variable name
|
# Store token in .env under the role-specific variable name
|
||||||
if grep -q "^${token_var}=" "$env_file" 2>/dev/null; then
|
if grep -q "^${token_var}=" "$env_file" 2>/dev/null; then
|
||||||
sed -i "s|^${token_var}=.*|${token_var}=${agent_token}|" "$env_file"
|
# Use sed with alternative delimiter and proper escaping for special chars in token
|
||||||
|
local escaped_token
|
||||||
|
escaped_token=$(printf '%s\n' "$agent_token" | sed 's/[&/\]/\\&/g')
|
||||||
|
sed -i "s|^${token_var}=.*|${token_var}=${escaped_token}|" "$env_file"
|
||||||
echo " ${agent_name} token updated (${token_var})"
|
echo " ${agent_name} token updated (${token_var})"
|
||||||
else
|
else
|
||||||
printf '%s=%s\n' "$token_var" "$agent_token" >> "$env_file"
|
printf '%s=%s\n' "$token_var" "$agent_token" >> "$env_file"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue