Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
acf-postgresql
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
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
ACF
acf-postgresql
Commits
e34be123
Commit
e34be123
authored
Jul 02, 2009
by
Ted Trask
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Read data path from conf.d file, rather than hardcoded.
parent
c2e87095
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
postgresql-model.lua
postgresql-model.lua
+14
-6
No files found.
postgresql-model.lua
View file @
e34be123
...
...
@@ -6,18 +6,26 @@ require("fs")
require
(
"format"
)
-- Set variables
local
confdfile
=
"/etc/conf.d/postgresql"
local
processname
=
"postgresql"
local
packagename
=
"postgresql"
local
datadirectory
=
"/var/lib/postgresql/data/"
local
pidfile
=
"postmaster.pid"
local
path
=
"PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin "
local
filelist
=
fs
.
find_files_as_array
(
".*\.conf"
,
datadirectory
)
local
datadirectory
local
filelist
-- ################################################################################
-- LOCAL FUNCTIONS
local
determinefilelist
=
function
()
if
not
filelist
then
datadirectory
=
format
.
get_ini_entry
(
fs
.
read_file
(
confdfile
)
or
""
,
""
,
"PGDATA"
)
filelist
=
fs
.
find_files_as_array
(
".*%.conf"
,
datadirectory
)
end
return
filelist
end
-- ################################################################################
-- PUBLIC FUNCTIONS
...
...
@@ -36,7 +44,7 @@ end
function
getfilelist
()
local
listed_files
=
{}
for
i
,
name
in
ipairs
(
filelist
)
do
for
i
,
name
in
ipairs
(
determinefilelist
()
)
do
local
filedetails
=
fs
.
stat
(
name
)
or
{}
table.insert
(
listed_files
,
{
filename
=
name
,
mtime
=
filedetails
.
mtime
or
"---"
,
filesize
=
filedetails
.
size
or
"0"
}
)
end
...
...
@@ -47,9 +55,9 @@ function getfilelist()
end
function
getfiledetails
(
filename
)
return
modelfunctions
.
getfiledetails
(
filename
,
filelist
)
return
modelfunctions
.
getfiledetails
(
filename
,
determinefilelist
()
)
end
function
updatefiledetails
(
filedetails
)
return
modelfunctions
.
setfiledetails
(
filedetails
,
filelist
)
return
modelfunctions
.
setfiledetails
(
filedetails
,
determinefilelist
()
)
end
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