divers: inst-depl, gsbboot,

This commit is contained in:
“Albert
2021-04-01 15:46:19 +02:00
parent 3b6da78d7c
commit c391a3dc39
5 changed files with 114 additions and 41 deletions

View File

@@ -1,24 +1,16 @@
#!/bin/bash
## ps : 2021-04-01 15:25
set -o errexit
set -o pipefail
GITUSR=gitgsb
GITPRJ=gsb
GITPRJ=gsb2021
apt update && apt upgrade
apt install -y apache2 git
getent passwd "${GITUSR}" >> /dev/null
if [[ $? != 0 ]]; then
echo "creation utilisateur "${GITUSR}" ..."
/sbin/useradd -m -d /home/"${GITUSR}" -s /bin/bash "${GITUSR}"
echo "${GITUSR}:${GITUSR}" | /sbin/chpasswd
else
echo "utilisateur "${GITUSR}" existant..."
fi
su -c "git init --share --bare /home/${GITUSR}/${GITPRJ}.git" "${GITUSR}"
su -c "cd ${GITPRJ}.git/.git/hooks && mv post-update.sample post-update" "${GITUSR}"
[[ -h /var/www/html/"${GITPRJ}".git ]]|| ln -s /home/"${GITUSR}"/"${GITPRJ}".git /var/www/html/"${GITPRJ}".git
[[ -d /var/www/html/gsbstore ]]|| mkdir /var/www/html/gsbstore
STOREREP="/var/www/html/gsbstore"
[[ -d "${STOREREP}" ]]|| mkdir "${STOREREP}"
(cat <<EOT > /var/www/html/gsbstore/getall
(cat <<EOT > "${STOREREP}/getall"
#!/bin/bash