-
Notifications
You must be signed in to change notification settings - Fork 3
/
servicesstatus.applescript
executable file
·60 lines (57 loc) · 1.66 KB
/
servicesstatus.applescript
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
-- servicesstatus.applescript
-- ServeBox
-- Created by Alex Coomans on 7/27/08.
-- Copyright 2008 __MyCompanyName__. All rights reserved.
my refresh()
if visible of window "statushud" is false then
set visible of window "statushud" to true
tell window "statushud"
activate
end tell
end if
on clicked theObject
if the name of theObject is "refresh" then
my refresh()
end if
if the name of theObject is "refresh60" then
repeat
set state1 to the state of button "refresh60" of window "statushud"
if state1 is 1 then
delay 5
my refresh()
end if
end repeat
end if
end clicked
on refresh()
do shell script "ps -A -C"
set _Result to the result
-- apache
if _Result contains "/Applications/servebox/services/apache/sbin/httpd -k start" then
set apacherunning to 1
else
set apacherunning to 0
end if
--mysql
if _Result contains "/Applications/servebox/services/Library/mysql/bin/mysqld" then
set mysqlrunning to 1
else
set mysqlrunning to 0
end if
--apache status set
if apacherunning is 1 then
set visible of image view "apacheminus" of window "statushud" to false
set visible of image view "apacheplus" of window "statushud" to true
else
set visible of image view "apacheplus" of window "statushud" to false
set visible of image view "apacheminus" of window "statushud" to true
end if
--mysql status set
if mysqlrunning is 1 then
set visible of image view "mysqlminus" of window "statushud" to false
set visible of image view "mysqlplus" of window "statushud" to true
else
set visible of image view "mysqlplus" of window "statushud" to false
set visible of image view "mysqlminus" of window "statushud" to true
end if
end refresh