Manage gogs config file during upgrades

This commit is contained in:
Bob Mottram 2017-04-12 18:22:39 +01:00
parent 60289687f4
commit 79e446f01d
1 changed files with 6 additions and 0 deletions

View File

@ -146,6 +146,9 @@ function upgrade_gogs {
return
fi
GOGS_CONFIG_FILE=/home/${GOGS_USERNAME}/custom/conf/app.ini
cp $GOGS_CONFIG_FILE $INSTALL_DIR/gogs_config.ini
gogs_parameters
echo "gogs binary upgrade: ${GOGS_BIN}"
@ -184,6 +187,9 @@ function upgrade_gogs {
rm ${GOGS_FILE}
fi
cp $INSTALL_DIR/gogs_config.ini $GOGS_CONFIG_FILE
rm $INSTALL_DIR/gogs_config.ini
sed -i "s|gogs version.*|gogs version:$GOGS_VERSION|g" ${COMPLETION_FILE}
systemctl restart gogs
}