function to remove gogs
This commit is contained in:
parent
4d2c1836ac
commit
7612453887
|
@ -35,6 +35,31 @@ GIT_DOMAIN_REPO="https://github.com/gogits/gogs"
|
|||
GIT_ADMIN_PASSWORD=
|
||||
GOGS_COMMIT='3fb4f7f4980b4339fd9ef6a3ba5b0acab83d264d'
|
||||
|
||||
function remove_gogs {
|
||||
if ! grep -Fxq "install_gogs" $COMPLETION_FILE; then
|
||||
return
|
||||
fi
|
||||
function_check select_go_version
|
||||
select_go_version
|
||||
|
||||
systemctl stop gogs
|
||||
systemctl disable gogs
|
||||
nginx_dissite $GIT_DOMAIN_NAME
|
||||
if [ -d /var/www/$GIT_DOMAIN_NAME ]; then
|
||||
rm -rf /var/www/$GIT_DOMAIN_NAME
|
||||
fi
|
||||
if [ -f /etc/nginx/sites-available/$GIT_DOMAIN_NAME ]; then
|
||||
rm /etc/nginx/sites-available/$GIT_DOMAIN_NAME
|
||||
fi
|
||||
function_check drop_database
|
||||
drop_database gogs
|
||||
rm /etc/systemd/system/gogs.service
|
||||
rm -rf $GOPATH/src/github.com/gogits
|
||||
userdel -r git
|
||||
sed -i '/install_gogs/d' $COMPLETION_FILE
|
||||
sed -i '/Gogs /d' $COMPLETION_FILE
|
||||
}
|
||||
|
||||
function install_gogs {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue