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.

39 lines
984 B

#!/bin/bash
# Author: Tealk
# Repo: https://codeberg.org/Tealk/shell-administration-script
# shellcheck disable=SC2034
title="Extracting"
printf " %b %s..." "${INFO}" "${title}"
if [ "${PROGNAME}" = "NextCloud" ]; then
if ! tar -xjf "${WEBPATH}"/"${ARCHIVE}" -C "${WEBPATH}" >/dev/null 2>&1; then
reason="can't unpack"
ERROR
fi
elif [ "${PROGNAME}" = "framadate" ]; then
if ! unzip "${WEBPATH}"/"${ARCHIVE}" -d "${WEBPATH}" >/dev/null 2>&1; then
reason="can't unpack"
ERROR
fi
else
if ! tar -xzf "${WEBPATH}"/"${ARCHIVE}" -C "${WEBPATH}" >/dev/null 2>&1; then
reason="can't unpack"
ERROR
fi
fi
if [ ! "${WEBPATH}"/"${WEBFOLDER}" = "${WEBPATH}"/"${ARCHIVEFOLDER}" ]; then
if ! mv "${WEBPATH}"/"${ARCHIVEFOLDER}" "${WEBPATH}"/"${WEBFOLDER}" >/dev/null 2>&1; then
reason="can't rename folder"
ERROR
fi
fi
if ! rm "${WEBPATH}"/"${ARCHIVE}" >/dev/null 2>&1; then
reason="can't remove archive"
ERROR
fi
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${title}"