#!/usr/bin/python3
from subprocess import check_output
from os import system
from sys import argv, exit

def main():
    currentVersion = check_output("curl https://raw.githubusercontent.com/ekorneechev/Connector/master/VERSION 2>/dev/null; exit 0",shell=True, universal_newlines=True).strip()
    if currentVersion and currentVersion != argv[1] and len(currentVersion) <= 8:
        system("zenity --notification --window-icon='info' --text='Программа Connector\nВаша версия программы устарела!\nТекущая: " + argv[1] + "\nАктуальная: " +  currentVersion + "'")
    exit(0)

if __name__ == "__main__":
    main()
