Restore gogs config

This commit is contained in:
Bob Mottram 2017-09-07 10:58:09 +01:00
parent 11e6257545
commit 9085239218
1 changed files with 3 additions and 7 deletions

View File

@ -266,14 +266,10 @@ function restore_local_gogs {
temp_restore_dir=/root/tempgogs
if [ -d ${USB_MOUNT}/backup/gogs ]; then
echo $"Restoring Gogs settings"
if [ ! -d /home/${GOGS_USERNAME}/custom ]; then
mkdir -p /home/${GOGS_USERNAME}/custom
fi
if [ ! -d ${temp_restore_dir}/home/${GOGS_USERNAME}/custom ]; then
cp -r ${temp_restore_dir}/home/${GOGS_USERNAME}/custom/* /home/${GOGS_USERNAME}/custom
else
cp -r ${temp_restore_dir}/* /home/${GOGS_USERNAME}/custom/
if [ ! -d /home/${GOGS_USERNAME}/custom/conf ]; then
mkdir -p /home/${GOGS_USERNAME}/custom/conf
fi
cp -r ${temp_restore_dir}/conf/* /home/${GOGS_USERNAME}/custom/conf/
if [ ! "$?" = "0" ]; then
function_check set_user_permissions
set_user_permissions