diff --git a/src/freedombone-utils-go b/src/freedombone-utils-go index 90164262..0cc41786 100755 --- a/src/freedombone-utils-go +++ b/src/freedombone-utils-go @@ -204,6 +204,13 @@ function upgrade_golang { rootdir= mesh_upgrade_golang + # alter the go version used by the gogs daemon + if [ -f /etc/systemd/system/gogs.service ]; then + sed -i "s|Environment=.*|Environment=\"USER=gogs\" \"HOME=/home/gogs\" \"GOPATH=/home/go/go${GO_VERSION}\"|g" /etc/systemd/system/gogs.service + systemctl daemon-reload + systemctl restart gogs + fi + echo "upgrade_golang:$GO_VERSION" >> $COMPLETION_FILE }