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
7e4d7546
Commit
7e4d7546
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Avoid the possibility of app settings file being changed while it is being parsed
parent
a8a9857f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-installer
+10
-7
10 additions, 7 deletions
src/freedombone-installer
with
10 additions
and
7 deletions
src/freedombone-installer
+
10
−
7
View file @
7e4d7546
...
...
@@ -1616,28 +1616,32 @@ function update_app_settings {
if
[
!
-f
"
$appsettings_file
"
]
;
then
return
fi
settings_data
=
$(
cat
"
$appsettings_file
"
)
rm
"
$appsettings_file
"
cp
"
$appsettings_file
"
"
$webadmin_install_dir
/appsettings.txt"
echo
''
>>
"
$webadmin_install_dir
/appsettings.txt"
echo
'update_app_settings'
>>
"
$webadmin_install_dir
/appsettings.txt"
if
grep
-q
','
"
$appsettings_file
"
;
then
app_name
=
$(
awk
-F
','
'{print $1}'
<
"
$appsettings_file
"
)
if
[[
"
$settings_data
"
==
*
','
*
]]
;
then
app_name
=
$(
echo
"
$settings_data
"
|
awk
-F
','
'{print $1}'
)
echo
"app_name:
${
app_name
}
"
>>
"
$webadmin_install_dir
/appsettings.txt"
if
[
"
$app_name
"
]
;
then
app_filename
=
"/usr/share/
${
PROJECT_NAME
}
/apps/
${
PROJECT_NAME
}
-app-
${
app_name
}
"
echo
"app_filename:
${
app_filename
}
"
>>
"
$webadmin_install_dir
/appsettings.txt"
if
[
-f
"
$app_filename
"
]
;
then
app_function
=
$(
awk
-F
','
'{print $2}'
<
"
$appsettings_file
"
)
app_function
=
$(
echo
"
$settings_data
"
|
awk
-F
','
'{print $2}'
)
echo
"app_function:
${
app_function
}
"
>>
"
$webadmin_install_dir
/appsettings.txt"
if
[
"
$app_function
"
]
;
then
if
grep
-q
"function setting_
${
app_function
}
{"
"
$app_filename
"
;
then
app_value
=
$(
awk
-F
','
'{print $3}'
<
"
$appsettings_file
"
)
echo
"app_value:
${
app_value
}
"
>>
"
$webadmin_install_dir
/appsettings.txt"
app_value
=
$(
echo
"
$settings_data
"
|
awk
-F
','
'{print $3}'
)
echo
"
test123
"
>>
"
$webadmin_install_dir
/appsettings.txt"
echo
"
app_value:
${
app_value
}
"
>>
"
$webadmin_install_dir
/appsettings.txt"
echo
"script:
$appsettings_script
"
>>
"
$webadmin_install_dir
/appsettings.txt"
check_for_existing_processes
$appsettings_script
ls
-l
$appsettings_script
>>
"
$webadmin_install_dir
/appsettings.txt"
{
echo
"echo
\"
Beginning webadmin
${
app_name
}
app settings change
\$
(date)
\"
"
;
echo
"PROJECT_NAME=
$PROJECT_NAME
"
;
echo
"source
$app_filename
"
;
...
...
@@ -1658,7 +1662,6 @@ function update_app_settings {
echo
'No settings specified'
>>
"
$webadmin_install_dir
/appsettings.txt"
chown
www-data:www-data
"
$webadmin_install_dir
/appsettings.txt"
fi
rm
"
$appsettings_file
"
}
# If the freedombone command is already running then kill its process
...
...
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