Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
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
mediaserver
envsetup
Commits
36a7f2fd
Commit
36a7f2fd
authored
8 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Do not replace unchanged conf (refs
#19005
).
parent
af444299
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
21.Initialize_configuration_file/0_setup.sh
+7
-5
7 additions, 5 deletions
21.Initialize_configuration_file/0_setup.sh
with
7 additions
and
5 deletions
21.Initialize_configuration_file/0_setup.sh
+
7
−
5
View file @
36a7f2fd
...
...
@@ -13,18 +13,20 @@ fi
# Autogenerate missing values
if
[
"
${
MS_ID
}
"
=
""
]
;
then
MS_ID
=
$(
echo
"
$(
hostname
)
_msuser"
)
sed
-i
"s@^MS_ID=.*@MS_ID='
${
MS_ID
}
'@"
/root/envsetup/conf.sh
fi
if
[
"
${
MS_API_KEY
}
"
=
""
]
;
then
MS_API_KEY
=
$(
echo
"s
$(
pwgen 4
)
-
$(
pwgen 5
)
-
$(
pwgen 5
)
-
$(
pwgen 5
)
-
$(
pwgen 5
)
"
)
# respect API pattern
MS_API_KEY
=
$(
echo
$MS_API_KEY
|
sed
"s@[iloILO]@
$((${
RANDOM
}
/
10000
))
@g"
)
sed
-i
"s@^MS_API_KEY=.*@MS_API_KEY='
${
MS_API_KEY
}
'@"
/root/envsetup/conf.sh
fi
if
[
"
${
MS_SECRET
}
"
=
"secret"
]
;
then
MS_SECRET
=
$(
echo
"
$(
pwgen 40
)
"
)
sed
-i
"s@^MS_SECRET=.*@MS_SECRET='
${
MS_SECRET
}
'@"
/root/envsetup/conf.sh
fi
sed
-i
"s@^MS_ID=.*@MS_ID='
${
MS_ID
}
'@"
/root/envsetup/conf.sh
sed
-i
"s@^MS_API_KEY=.*@MS_API_KEY='
${
MS_API_KEY
}
'@"
/root/envsetup/conf.sh
sed
-i
"s@^MS_SECRET=.*@MS_SECRET='
${
MS_SECRET
}
'@"
/root/envsetup/conf.sh
# Worker IP for whitelist
CELERITY_WORKER_IP
=
$(
ip addr show |
grep
inet |
grep
-v
127 |
grep
-v
":"
|
awk
-F
" "
'{print$2}'
|
awk
-F
"/"
'{print$1}'
)
sed
-i
"s@^CELERITY_CELERITY_WORKER_IP=.*@CELERITY_CELERITY_WORKER_IP='
${
CELERITY_WORKER_IP
}
'@"
/root/envsetup/conf.sh
if
[
"
${
CELERITY_WORKER_IP
}
"
=
""
]
;
then
CELERITY_WORKER_IP
=
$(
ip addr show |
grep
inet |
grep
-v
127 |
grep
-v
":"
|
awk
-F
" "
'{print$2}'
|
awk
-F
"/"
'{print$1}'
)
sed
-i
"s@^CELERITY_CELERITY_WORKER_IP=.*@CELERITY_CELERITY_WORKER_IP='
${
CELERITY_WORKER_IP
}
'@"
/root/envsetup/conf.sh
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