Shorten installation by including some installation steps into a shell script

This commit is contained in:
Torben Brenner
2022-05-17 18:04:15 +02:00
committed by Martin Lablans
parent 865870ea91
commit b175c55f5c
8 changed files with 138 additions and 57 deletions

View File

@ -34,8 +34,13 @@ function hc_send(){
fi
if [ -z "$USER_AGENT" ]; then
COMMIT_ETC=$(git -C /etc/bridgehead rev-parse HEAD | cut -c -8)
COMMIT_SRV=$(git -C /srv/docker/bridgehead rev-parse HEAD | cut -c -8)
if [ "$USER" != "root" ]; then
COMMIT_ETC=$(git -C /etc/bridgehead rev-parse HEAD | cut -c -8)
COMMIT_SRV=$(git -C /srv/docker/bridgehead rev-parse HEAD | cut -c -8)
else
COMMIT_ETC=$(su -c 'git -C /etc/bridgehead rev-parse HEAD' bridgehead | cut -c -8)
COMMIT_SRV=$(su -c 'git -C /srv/docker/bridgehead rev-parse HEAD' bridgehead | cut -c -8)
fi
USER_AGENT="srv:$COMMIT_SRV etc:$COMMIT_ETC"
fi