Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
postgresql-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
postgresql-conf
Commits
4022284a
Commit
4022284a
authored
Apr 25, 2025
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
postgresql
postgresql
+78
-0
No files found.
Makefile
0 → 100644
View file @
4022284a
all
:
postgresql-config
@
echo
"
$$
POSTGRESQL_CONFIG"
>
/etc/config/postgresql
install
-v
-Dm755
postgresql /usr/share/easycwmp/functions
postgresql-config
:
define
POSTGRESQL_CONFIG
config
postgresql
'credentials'
option
hostname
''
option
database
''
option
username
''
option
password
''
endef
export
POSTGRESQL_CONFIG
postgresql
0 → 100755
View file @
4022284a
#!/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
.PostgreSQL."
entry_execute_method_list
=
"
$entry_execute_method_list
entry_execute_method_root_PostgreSQL"
entry_execute_method_list_forcedinform
=
"
$entry_execute_method_list_forcedinform
entry_execute_method_root_PostgreSQL"
entry_execute_method_root_PostgreSQL
()
{
case
"
$1
"
in
""
|
"
$DMROOT
."
|
"
$DMROOT
.PostgreSQL."
*
)
common_execute_method_obj
"
$DMROOT
.PostgreSQL."
"0"
common_execute_method_param
"
$DMROOT
.PostgreSQL.HostName"
"1"
"postgresql_get_hostname"
"postgresql_set_hostname"
common_execute_method_param
"
$DMROOT
.PostgreSQL.Database"
"1"
"postgresql_get_database"
"postgresql_set_database"
common_execute_method_param
"
$DMROOT
.PostgreSQL.UserName"
"1"
"postgresql_get_username"
"postgresql_set_username"
common_execute_method_param
"
$DMROOT
.PostgreSQL.Password"
"1"
""
"postgresql_set_password"
return
0
;
;;
esac
return
$E_INVALID_PARAMETER_NAME
;
}
#######################################
# Data model parameters functions #
#######################################
postgresql_get_hostname
()
{
echo
`
$UCI_GET
postgresql.credentials.hostname
`
}
postgresql_set_hostname
()
{
local hostname
=
`
$UCI_GET
postgresql.credentials.hostname
`
if
[
"
$hostname
"
!=
"
$1
"
]
;
then
$UCI_SET
postgresql.credentials.hostname
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/postgresql
fi
}
postgresql_get_database
()
{
echo
`
$UCI_GET
postgresql.credentials.database
`
}
postgresql_set_database
()
{
local
database
=
`
$UCI_GET
postgresql.credentials.database
`
if
[
"
$database
"
!=
"
$1
"
]
;
then
$UCI_SET
postgresql.credentials.database
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/postgresql
fi
}
postgresql_get_username
()
{
echo
`
$UCI_GET
postgresql.credentials.username
`
}
postgresql_set_username
()
{
local
username
=
`
$UCI_GET
postgresql.credentials.username
`
if
[
"
$username
"
!=
"
$1
"
]
;
then
$UCI_SET
postgresql.credentials.username
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/postgresql
fi
}
postgresql_set_password
()
{
local
password
=
`
$UCI_GET
postgresql.credentials.password
`
if
[
"
$password
"
!=
"
$1
"
]
;
then
$UCI_SET
postgresql.credentials.password
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/postgresql
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