-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathserver-management-sample.sh
More file actions
executable file
·81 lines (69 loc) · 1.88 KB
/
server-management-sample.sh
File metadata and controls
executable file
·81 lines (69 loc) · 1.88 KB
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
73
74
75
76
77
78
79
80
#!/bin/bash
# This is an example script that can start, stop, and check status
# of a Xataface project. It probably isn't reusable, but is a good
# example of how you might automate your server management in Shellmarks
PORT="9090"
TUXPIN_PATH=/path/to/tuxpin
URL="http://localhost:$PORT"
if [ ! -z "$startServer" ]; then
ACTIVE=$(lsof -P -i TCP -s TCP:LISTEN | grep "$PORT")
if [ ! -z "$ACTIVE" ]; then
if [ ! -z "$openOnStart" ]; then
open "$URL"
fi
exit 0
fi
cd "$TUXPIN_PATH"
xataface start
if [ ! -z "$openOnStart" ]; then
open $URL
fi
fi
if [ ! -z "$stopServer" ]; then
ACTIVE=$(lsof -P -i TCP -s TCP:LISTEN | grep "$PORT")
if [ ! -z "$ACTIVE" ]; then
cd "$TUXPIN_PATH"
xataface stop
else
echo "Server is already stopped"
fi
fi
if [ ! -z "$serverStatus" ]; then
ACTIVE=$(lsof -P -i TCP -s TCP:LISTEN | grep "$PORT")
if [ -z "$ACTIVE" ]; then
echo "Server is not active"
else
echo "Server is currently running on port $PORT"
fi
fi
exit 0
---
# The script title
__title__="Tuxpin Dev Server"
# Script description in Asciidoc format
__description__='''
This script will start or stop the Tuxpin development server.
It will then open it in a new browser window.
. http://localhost:9090/admin.php[Tuxpin Admin]
. http://localhost:9090/phpmyadmin[PHPmyAdmin]
'''
# Tags used to place script into one or more sections of the catalog
__tags__="#tuxpin"
[startServer]
type="button"
label="Start Server"
help="Start tuxpin server"
disposeOnSubmit=false
[stopServer]
type="button"
label="Stop Server"
help="Stop tuxpin server"
disposeOnSubmit=false
[serverStatus]
type="button"
label="Server Status"
help="Check server status"
disposeOnSubmit=false
[openOnStart]
type="checkbox"
label="Open Tuxpin in Browser on Start"