Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Context Sensitive Group
freedombone
Commits
e500a0de
Commit
e500a0de
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Remove mongodb when appropriate
parent
89b7087c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/freedombone-app-smilodon
+4
-1
4 additions, 1 deletion
src/freedombone-app-smilodon
src/freedombone-utils-mongodb
+35
-0
35 additions, 0 deletions
src/freedombone-utils-mongodb
with
39 additions
and
1 deletion
src/freedombone-app-smilodon
+
4
−
1
View file @
e500a0de
...
...
@@ -256,6 +256,9 @@ function remove_smilodon {
function_check drop_database_mongodb
drop_database_mongodb smilodon
function_check remove_mongodb
remove_mongodb smilodon
remove_completion_param install_smilodon
sed
-i
'/smilodon_/d'
$COMPLETION_FILE
}
...
...
@@ -289,7 +292,7 @@ function install_smilodon {
useradd
-c
"Smilodon system account"
-d
$SMILODON_PATH
-m
-r
-g
smilodon smilodon
function_check install_mongodb
install_mongodb
install_mongodb
smilodon
smilodon_create_database
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-utils-mongodb
+
35
−
0
View file @
e500a0de
...
...
@@ -30,6 +30,7 @@
# Set this when calling backup and restore commands
USE_MONGODB
=
MONGODB_APPS_FILE
=
/root/.mongodbapps
function
store_original_mongodb_password
{
if
[
!
-f
/root/.mongodboriginal
]
;
then
...
...
@@ -49,6 +50,8 @@ function get_mongodb_password {
}
function
install_mongodb
{
app_name
=
$1
if
[[
"
$(
uname
-a
)
"
==
*
"armv7"
*
]]
;
then
echo
$'mongodb package is not available for arm 7 architecture'
exit
7356272
...
...
@@ -81,9 +84,41 @@ function install_mongodb {
exit
78352
fi
if
[
$app_name
]
;
then
if
!
grep
-q
"
$app_name
"
$MONGODB_APPS_FILE
;
then
echo
"
$app_name
"
>>
$MONGODB_APPS_FILE
fi
fi
mark_completed
$FUNCNAME
}
function
remove_mongodb
{
app_name
=
$1
if
[
!
$app_name
]
;
then
return
fi
removemongo
=
if
[
-f
$MONGODB_APPS_FILE
]
;
then
sed
-i
"/
$app_name
/d"
$MONGODB_APPS_FILE
mongoapps
=
$(
cat
$MONGODB_APPS_FILE
)
if
[
${#
mongoapps
}
-lt
3
]
;
then
removemongo
=
1
fi
else
removemongo
=
1
fi
if
[
$removemongo
]
;
then
apt-get
-yq
remove mongodb mongo-tools
if
[
-d
/var/lib/mongodb
]
;
then
rm
-rf
/var/lib/mongodb
fi
fi
}
function
add_mongodb_user
{
mongodb_username
=
$1
mongodb_password
=
$2
...
...
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