You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
828 B

#!/bin/bash
# Author: Tealk
# Repo: https://codeberg.org/Tealk/shell-administration-script
# shellcheck disable=SC2034
title="Update"
printf " %b %s..." "${INFO}" "${title}"
if [ "${PROGNAME}" = "BookStack" ]; then
cd "${FULLPATH}" || exit
if ! sudo -u "${WEBUSER}" composer install --no-dev >/dev/null 2>&1; then
reason="can't upgrade"
ERROR
fi
if ! sudo -u "${WEBUSER}" php artisan migrate --force >/dev/null 2>&1; then
reason="can't migrate"
ERROR
fi
# shellcheck disable=SC2154
cd "${rootdir}" || exit
fi
if [ "${PROGNAME}" = "Friendica" ]; then
cd "${FULLPATH}" || exit
chmod +x bin/composer.phar
if ! sudo -u "${WEBUSER}" bin/composer.phar install --no-dev >/dev/null 2>&1; then
reason="can't upgrade"
ERROR
fi
cd "${rootdir}" || exit
fi
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${title}"