Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
docker-mariadb-repl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
ale
docker-mariadb-repl
Commits
b4918f6f
Commit
b4918f6f
authored
7 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Work around lack of $RANDOM in dash
parent
94af59f1
Branches
master
No related tags found
No related merge requests found
Pipeline
#1270
passed
6 years ago
Stage: build
Stage: release
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.sh
+3
-2
3 additions, 2 deletions
setup.sh
with
3 additions
and
2 deletions
setup.sh
+
3
−
2
View file @
b4918f6f
...
@@ -8,14 +8,15 @@ DATADIR=/data
...
@@ -8,14 +8,15 @@ DATADIR=/data
# Get or generate a unique server ID.
# Get or generate a unique server ID.
get_server_id
()
{
get_server_id
()
{
if
[
!
-e
${
DATADIR
}
/.server-id
]
;
then
if
[
!
-e
${
DATADIR
}
/.server-id
]
;
then
echo
$RANDOM
>
${
DATADIR
}
/.server-id
# Oops, dash has no $RANDOM.
shuf
-i
1-65535
-n
1
>
${
DATADIR
}
/.server-id
fi
fi
cat
${
DATADIR
}
/.server-id
cat
${
DATADIR
}
/.server-id
}
}
# Configure the server, replication state is unknown yet.
# Configure the server, replication state is unknown yet.
configure_server
()
{
configure_server
()
{
local
server_id
=
$(
get_server_id
)
local
server_id
=
`
get_server_id
`
echo
"Server ID is
${
server_id
}
"
>
&2
echo
"Server ID is
${
server_id
}
"
>
&2
# If /data/conf.d exists, load configuration snippets from there.
# If /data/conf.d exists, load configuration snippets from there.
...
...
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