-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUpdateAgent.69.matrix.sh
73 lines (50 loc) · 1.33 KB
/
UpdateAgent.69.matrix.sh
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
#lynx is required to run this script
wget -q --tries=10 --timeout=20 --spider http://google.com
if [[ $? -eq 0 ]]; then
echo "Online"
else
echo "offline"
zenity --warning \
--title="Update | Network Error" \
--text="It appears as though you are not connected to the internet." \
--ok-label="OK"
fi
(
echo "10" ; sleep .1
echo "# Checking for connection..." ; sleep .3
echo "20" ; sleep .1
echo "# Checking for connection..." ; sleep .3
echo "50" ; sleep .3
echo " Getting Current Version..." ; sleep .4
echo "75" ; sleep .2
echo "# Getting Current Version..." ; sleep .5
echo "100" ; sleep .2
) |
zenity --progress --auto-close \
--title="Updates" \
--text="Checking for connection" \
--percentage=0
if [ "$?" = -1 ] ; then
zenity --error \
--text="Error"
fi
source "/Users/sellersew/Desktop/Update Agent/Info.sh"
ServerCode=$(lynx -dump $Link$Region/$Version)
echo $ServerCode
if [[ $ServerCode == *"404"* ]]
then
#No update
zenity --info \
--title="Updates | PolarOS" \
--text="Your computer has the newest version of PolarOS."
else
#Update avaible
zenity --question \
--title="Updates | PolarOS" \
--text '<span foreground="black" font="15"><b>PolarOS Updates</b></span>\n<span foreground="black" font="10">Polar Computers Inc.</span>\n' \
--ok-label="Install now" \
--cancel-label="Later"
#Download File
#Install File
fi