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.

77 lines
2.0 KiB

#!/bin/bash
# Author: Tealk
# Repo: https://codeberg.org/Tealk/shell-administration-script
# shellcheck disable=SC2034
title="Move files in place"
printf " %b %s..." "${INFO}" "${title}"
if [ "${PROGNAME}" = "phpMyAdmin" ]; then
if ! cp "${FULLPATH}"_bak/config.inc.php "${FULLPATH}"/config.inc.php >/dev/null 2>&1; then
reason="can't copy conig file"
ERROR
fi
fi
if [ "${PROGNAME}" = "NextCloud" ]; then
if ! cp "${FULLPATH}"_bak/config/*.php "${FULLPATH}"/config/ >/dev/null 2>&1; then
reason="can't copy conig file"
ERROR
fi
fi
if [ "${PROGNAME}" = "MediaWiki" ]; then
if ! cp "${FULLPATH}"_bak/LocalSettings.php "${FULLPATH}"/LocalSettings.php >/dev/null 2>&1; then
reason="can't copy conig file"
ERROR
fi
if ! cp "${FULLPATH}"_bak/.htaccess "${FULLPATH}"/.htaccess >/dev/null 2>&1; then
reason="can't copy .htaccess file"
ERROR
fi
if [ -n "${EXTENSIONS}" ]; then
echo "Enter versions number: e.g. REL1_32 = 1.32.x"
read -r REL
for IEXT in "${EXTENSIONS[@]}"; do
if ! git clone --quiet https://gerrit.wikimedia.org/r/mediawiki/extensions/"${IEXT}" --branch "${REL}" "${FULLPATH}"/extensions/"${IEXT}" >/dev/null 2>&1; then
reason="can't copy extensions ${IEXT}"
ERROR
fi
echo "${IAPP}" was successfully downloaded
done
fi
if [ -n "${SKINS}" ]; then
for ISKIN in "${SKINS[@]}"; do
if ! cp -r "${FULLPATH}"_bak/skins/"${ISKIN}"/ "${FULLPATH}"/skins/ >/dev/null 2>&1; then
reason="can't copy skins ${ISKIN}"
ERROR
fi
echo "${IAPP}" was copied successfully
done
fi
fi
if [ "${PROGNAME}" = "writefreely" ]; then
if ! cp "${FULLPATH}"_bak/config.ini "${FULLPATH}"/ >/dev/null 2>&1; then
reason="can't copy conig file"
ERROR
fi
if ! cp "${FULLPATH}"_bak/keys/* "${FULLPATH}"/keys/ >/dev/null 2>&1; then
reason="can't copy key file"
ERROR
fi
fi
if [ "${PROGNAME}" = "framadate" ]; then
if ! cp "${FULLPATH}"_bak/app/inc/config.php "${FULLPATH}"/app/inc/ >/dev/null 2>&1; then
reason="can't copy conig file"
ERROR
fi
fi
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${title}"