Last active
May 25, 2021 04:28
-
-
Save zorn-v/03c01c93aa4f299274b4f018983a6a5f to your computer and use it in GitHub Desktop.
Install/update portproton
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
BASE_URL=https://portwine-linux.ru/ftp | |
VERSION=$1 | |
[ -z "$VERSION" ] && VERSION=`curl -s ${BASE_URL}/current_version/PortProton_ver` | |
cd `dirname $0` | |
[ -f data/tmp/PortProton_ver ] && CUR_VER=`cat data/tmp/PortProton_ver` | |
[ "$CUR_VER" = "$VERSION" ] && echo You already have $VERSION version && exit 0 | |
rm -rf update | |
mkdir update | |
cd update | |
wget -Osha256 ${BASE_URL}/portwine/PortProton-${VERSION}.sha256sum | |
wget -OPortProton ${BASE_URL}/portwine/PortProton-${VERSION} | |
LOCAL_SUM=`sha256sum PortProton | cut -d' ' -f1` | |
REMOTE_SUM=`cat sha256 | cut -d' ' -f1` | |
[ "$LOCAL_SUM" != "$REMOTE_SUM" ] && echo Hash sum does not match && exit 1 | |
ARCH_LINE=`cat PortProton | grep -a 'tail -n +' | sed 's/[^0-9]//g'` | |
tail -n +${ARCH_LINE} PortProton > PortProton.tar.xz | |
tar xvf PortProton.tar.xz | |
echo PortProton > data/tmp/portname | |
echo $VERSION > data/tmp/PortProton_ver | |
echo RUS > data/tmp/PortProton_loc | |
cd .. | |
if [ -d data ] | |
then | |
cp -nv data/scripts/portwine_db/* update/data/scripts/portwine_db/ | |
mv -f data data_${CUR_VER} | |
fi | |
mv update/data ./ | |
[ ! -d users_data ] && mkdir users_data | |
mkdir -p data/pfx/drive_c | |
ln -s ../../../users_data data/pfx/drive_c/users | |
rm -rf update | |
INSTALLING_PORT=1 s_install=1 $(readlink -f $(dirname $0))/data/scripts/setup.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment