Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mongodb-conf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
certo
mongodb-conf
Commits
f241b5cd
Commit
f241b5cd
authored
Apr 07, 2019
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial commit
parents
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
0 deletions
+92
-0
Makefile
Makefile
+14
-0
mongodb
mongodb
+78
-0
No files found.
Makefile
0 → 100644
View file @
f241b5cd
all
:
mongodb-config
@
echo
"
$$
MONGODB_CONFIG"
>
/etc/config/mongodb
install
-v
-Dm755
mongodb /usr/share/easycwmp/functions
mongodb-config
:
define
MONGODB_CONFIG
config
mongodb
'credentials'
option
hostname
''
option
database
''
option
username
''
option
password
''
endef
export
MONGODB_CONFIG
mongodb
0 → 100755
View file @
f241b5cd
#!/bin/sh
#common_execute_method_param "$parameter" "$permission" "$get_cmd" "$set_cmd" "xsd:$type" "$forcedinform"
# $forcedinform should be set to 1 if the parameter is included in the inform message otherwise empty
# Default of $type = string
#############################
# Entry point functuons #
#############################
prefix_list
=
"
$prefix_list
$DMROOT
.MongoDB."
entry_execute_method_list
=
"
$entry_execute_method_list
entry_execute_method_root_MongoDB"
entry_execute_method_list_forcedinform
=
"
$entry_execute_method_list_forcedinform
entry_execute_method_root_MongoDB"
entry_execute_method_root_MongoDB
()
{
case
"
$1
"
in
""
|
"
$DMROOT
."
|
"
$DMROOT
.MongoDB."
*
)
common_execute_method_obj
"
$DMROOT
.MongoDB."
"0"
common_execute_method_param
"
$DMROOT
.MongoDB.HostName"
"1"
"mongodb_get_hostname"
"mongodb_set_hostname"
common_execute_method_param
"
$DMROOT
.MongoDB.Database"
"1"
"mongodb_get_database"
"mongodb_set_database"
common_execute_method_param
"
$DMROOT
.MongoDB.UserName"
"1"
"mongodb_get_username"
"mongodb_set_username"
common_execute_method_param
"
$DMROOT
.MongoDB.Password"
"1"
""
"mongodb_set_password"
return
0
;
;;
esac
return
$E_INVALID_PARAMETER_NAME
;
}
#######################################
# Data model parameters functions #
#######################################
mongodb_get_hostname
()
{
echo
`
$UCI_GET
mongodb.credentials.hostname
`
}
mongodb_set_hostname
()
{
local hostname
=
`
$UCI_GET
mongodb.credentials.hostname
`
if
[
"
$hostname
"
!=
"
$1
"
]
;
then
$UCI_SET
mongodb.credentials.hostname
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/mongodb
fi
}
mongodb_get_database
()
{
echo
`
$UCI_GET
mongodb.credentials.database
`
}
mongodb_set_database
()
{
local
database
=
`
$UCI_GET
mongodb.credentials.database
`
if
[
"
$database
"
!=
"
$1
"
]
;
then
$UCI_SET
mongodb.credentials.database
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/mongodb
fi
}
mongodb_get_username
()
{
echo
`
$UCI_GET
mongodb.credentials.username
`
}
mongodb_set_username
()
{
local
username
=
`
$UCI_GET
mongodb.credentials.username
`
if
[
"
$username
"
!=
"
$1
"
]
;
then
$UCI_SET
mongodb.credentials.username
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/mongodb
fi
}
mongodb_set_password
()
{
local
password
=
`
$UCI_GET
mongodb.credentials.password
`
if
[
"
$password
"
!=
"
$1
"
]
;
then
$UCI_SET
mongodb.credentials.password
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/mongodb
fi
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment