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
3f5a1bfd
Commit
3f5a1bfd
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Restart gogs after restore
parent
282d45cd
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-app-gogs
+17
-9
17 additions, 9 deletions
src/freedombone-app-gogs
with
17 additions
and
9 deletions
src/freedombone-app-gogs
+
17
−
9
View file @
3f5a1bfd
...
...
@@ -261,15 +261,22 @@ function restore_local_gogs {
function_check gogs_create_database
gogs_create_database
GOGS_CONFIG_PATH
=
/home/
${
GOGS_USERNAME
}
/custom/conf
GOGS_CONFIG_FILE
=
${
GOGS_CONFIG_PATH
}
/app.ini
function_check restore_database
restore_database gogs
${
GIT_DOMAIN_NAME
}
temp_restore_dir
=
/root/tempgogs
if
[
-d
${
USB_MOUNT
}
/backup/gogs
]
;
then
echo
$"Restoring Gogs settings"
if
[
!
-d
/home/
${
GOGS_USERNAME
}
/custom/conf
]
;
then
mkdir
-p
/home/
${
GOGS_USERNAME
}
/custom/conf
if
[
!
-d
$GOGS_CONFIG_PATH
]
;
then
mkdir
-p
$GOGS_CONFIG_PATH
fi
if
[
-d
/root/tempgogs/home/
${
GOGS_USERNAME
}
/custom
]
;
then
cp
-r
/root/tempgogs/home/
${
GOGS_USERNAME
}
/custom/
*
/home/
${
GOGS_USERNAME
}
/custom/
else
cp
-r
/root/tempgogs/
*
/home/
${
GOGS_USERNAME
}
/custom/
fi
cp
-r
${
temp_restore_dir
}
/conf/
*
/home/
${
GOGS_USERNAME
}
/custom/conf/
if
[
!
"
$?
"
=
"0"
]
;
then
function_check set_user_permissions
set_user_permissions
...
...
@@ -319,11 +326,10 @@ function restore_local_gogs {
chown
-R
${
GOGS_USERNAME
}
:
${
GOGS_USERNAME
}
/home/
${
GOGS_USERNAME
}
fi
GOGS_CONFIG_PATH
=
/home/
${
GOGS_USERNAME
}
/custom/conf
GOGS_CONFIG_FILE
=
${
GOGS_CONFIG_PATH
}
/app.ini
MARIADB_PASSWORD
=
$(
${
PROJECT_NAME
}
-pass
-u
root
-a
mariadb
)
sed
-i
"s|PASSWD =.*|PASSWD =
$MARIADB_PASSWORD
|g"
${
GOGS_CONFIG_FILE
}
MARIADB_PASSWORD
=
systemctl restart gogs
fi
}
...
...
@@ -363,11 +369,14 @@ function restore_remote_gogs {
function_check gogs_create_database
gogs_create_database
GOGS_CONFIG_PATH
=
/home/
${
GOGS_USERNAME
}
/custom/conf
GOGS_CONFIG_FILE
=
${
GOGS_CONFIG_PATH
}
/app.ini
function_check restore_database_from_friend
restore_database_from_friend gogs
${
GIT_DOMAIN_NAME
}
if
[
-d
${
SERVER_DIRECTORY
}
/backup/gogs
]
;
then
if
[
!
-d
/home/
${
GOGS_USERNAME
}
/custom
]
;
then
mkdir
-p
/home/
${
GOGS_USERNAME
}
/custom
if
[
!
-d
$GOGS_CONFIG_PATH
]
;
then
mkdir
-p
$GOGS_CONFIG_PATH
fi
if
[
-d
/root/tempgogs/home/
${
GOGS_USERNAME
}
/custom
]
;
then
cp
-r
/root/tempgogs/home/
${
GOGS_USERNAME
}
/custom/
*
/home/
${
GOGS_USERNAME
}
/custom/
...
...
@@ -410,11 +419,10 @@ function restore_remote_gogs {
echo
$"Restore of Gogs complete"
fi
GOGS_CONFIG_PATH
=
/home/
${
GOGS_USERNAME
}
/custom/conf
GOGS_CONFIG_FILE
=
${
GOGS_CONFIG_PATH
}
/app.ini
MARIADB_PASSWORD
=
$(
${
PROJECT_NAME
}
-pass
-u
root
-a
mariadb
)
sed
-i
"s|PASSWD =.*|PASSWD =
$MARIADB_PASSWORD
|g"
${
GOGS_CONFIG_FILE
}
MARIADB_PASSWORD
=
systemctl restart gogs
fi
}
...
...
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