-
Notifications
You must be signed in to change notification settings - Fork 328
/
updater.py
30 lines (24 loc) · 876 Bytes
/
updater.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
# Copyright 2017 BeeLogger
# Written by: * Alisson Moretto - 4w4k3
# https://github.com/4w4k3/BeeLogger
# Licensed under the BSD-3-Clause
import subprocess
import urllib2
def update_client_version(version):
with open("version.txt", "r") as vnum:
if vnum.read() != version:
return True
else:
return False
def main():
version = urllib2.urlopen("https://raw.githubusercontent.com/4w4k3/BeeLogger/master/version.txt").read()
if update_client_version(version) is True:
subprocess.call(["git", "pull", "origin", "master"])
return "[*] Updated to latest version: v{}..".format(version)
else:
return "[*] You are already up to date with git origin master."
if __name__ == '__main__':
print("[*] Checking version information..")
print(main())