PortWINE/portwine_run_scripts/port_update
2019-11-25 20:37:19 +03:00

88 lines
2.4 KiB
Bash
Executable File

#!/bin/bash
# Author: Tergoev M.A.
if [ ! -f "${config_path}/${portname}_ver" ]
then
echo "10" > "${config_path}/${portname}_ver"
fi
if [ ! -f "${config_path}/update_notifier" ]
then
echo "1" > "${config_path}/update_notifier"
fi
read "update_not" < "${config_path}/update_notifier"
if [ "${update_not}" -eq "1" ]
then
wget -T 2 --output-document="${config_path}/${portname}_cur_ver" "http://portwine-linux.ru/current_version/${portname}_ver"
sleep 1
if [ -f "${config_path}/${portname}_ver" ]
then
read current_ver < "${config_path}/${portname}_cur_ver"
read install_ver < "${config_path}/${portname}_ver"
rm -f "${config_path}/${portname}_cur_ver"
if [ "${current_ver}" -gt "${install_ver}" ]
then
xsd=`zenity --title "${port_upd1}" --text "${port_upd2}" --list --radiolist --height=220 --column="${inst_set}" --column "${port_upd3}" \
TRUE "${port_upd4}" \
FALSE "${port_upd5}" \
FALSE "${port_upd6}" `
case $xsd in
"${port_upd4}")
$WINESERVER -k
xdg-open $porturl
exit 0 ;;
"${port_upd5}")
echo " " ;;
"${port_upd6}")
echo "0" > "${config_path}/update_notifier" ;;
esac
fi
fi
fi
########################################################################
if [ ! -f "${HOME}/.config/.PortTime" ]
then
echo "10" > "${HOME}/.config/.PortTime"
fi
read "port_time" < "${HOME}/.config/.PortTime"
if [ "${port_time}" -gt "1" ]
then
port_time=$((${port_time}-1))
echo "${port_time}" > "${HOME}/.config/.PortTime"
else
xsd2=`zenity --title "${port_time1}" --text "${port_time2}" --list --radiolist --height=240 --column="${inst_set3}" --column "${port_time3}" \
TRUE "${port_time4}" \
FALSE "${port_time5}" \
FALSE "${port_time6}" `
if [ $? -eq 1 ]
then
echo "1" > "${HOME}/.config/.PortTime"
else
case $xsd2 in
"${port_time4}")
if [ "${update_loc}" = "ENG" ]
then
urlg="https://www.patreon.com/portwinelinux"
fi
if [ ! -z "$(command -v sensible-browser)" ]; then
sensible-browser "$urlg" &
elif [ ! -z "$(command -v xdg-open)" ]; then
xdg-open "$urlg" &
elif [ ! -z "$(command -v gnome-open)" ]; then
gnome-open "$urlg" &
elif [ ! -z "$(command -v python)" ]; then
python -m webbrowser "$urlg"
fi &
echo "90" > "${HOME}/.config/.PortTime"
sleep 5 ;;
"${port_time5}")
echo "30" > "${HOME}/.config/.PortTime" ;;
"${port_time6}")
echo "60" > "${HOME}/.config/.PortTime" ;;
esac
fi
fi