diff --git a/cli/upgrade.sh b/cli/upgrade.sh old mode 100644 new mode 100755 index fc01e110d..d411ecbbf --- a/cli/upgrade.sh +++ b/cli/upgrade.sh @@ -12,8 +12,10 @@ if [[ $(id -u) -ne 0 ]] ; then echo -e "\033[1;31mPlease run as root\033[0m" ; exit 1 ; fi -dir=$(pwd) -if [ ! -d "$dir/snappymail/v" ] ; then echo -e "\033[1;31mThis script can only be run from the SnappyMail install directory\033[0m" ; exit 1 ; fi +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}/.." + +if [ ! -d snappymail/v ] ; then echo -e "\033[1;31mThis script can only be run from the SnappyMail install directory\033[0m" ; exit 1 ; fi LATEST_URL="https://snappymail.eu/repository/latest.tar.gz" @@ -37,7 +39,7 @@ tar -xzf /tmp/snappymail_latest.tar.gz echo -e "\033[1;33mSet permissions\033[0m" find . -type d -exec chmod 755 {} \; find . -type f -exec chmod 644 {} \; -chmod u+x bin/upgrade.sh +chmod u+x cli/upgrade.sh chown -R $OWNERGROUP * echo -e "\033[1;32mFinished with snappymail upgrade from $OLD_VERSION to $NEW_VERSION... \033[0m" diff --git a/release.php b/release.php index 9c75e9030..f388ba0af 100755 --- a/release.php +++ b/release.php @@ -125,6 +125,9 @@ if ($options['docker']) { $tar->buildFromDirectory('./', "@snappymail/v/{$package->version}@"); } +//$zip->addFile('cli/upgrade.sh'); +//$tar->addFile('cli/upgrade.sh'); + $zip->addFile('data/.htaccess'); $tar->addFile('data/.htaccess');