-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathss
More file actions
76 lines (67 loc) · 1.5 KB
/
ss
File metadata and controls
76 lines (67 loc) · 1.5 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
#!/bin/bash
# $0 script path
# $1 action
# $2 subaction
function pidExists() {
if [ -e "pidfile" ];
then
kill -s 0 $(cat pidfile);
if [ !$? ];
then return 1;
else return 0;
fi
else
return 0;
fi
}
case "$1" in
start)
echo "Starting Stacktrace Storage";
echo " \"./nodebb stop\" to stop the Stacktrace Storage server";
echo " \"./nodebb log\" to view server output";
echo "" > ./logs/output.log;
node loader -d "$@"
;;
stop)
echo "Stopping Stacktrace Storage. Goodbye!";
kill $(cat pidfile);
;;
reload|restart)
echo "Restarting Stacktrace Storage.";
kill -1 $(cat pidfile);
;;
status)
pidExists;
if [ 0 -eq $? ];
then
echo "NodeBB is not running";
echo " \"./nodebb start\" to launch the Stacktrace Storage server";
return 1;
else
echo "NodeBB Running (pid $(cat pidfile))";
echo " \"./nodebb stop\" to stop the Stacktrace Storage server";
echo " \"./nodebb log\" to view server output";
echo " \"./nodebb restart\" to restart Stacktrace Storage";
return 0;
fi
;;
log)
clear;
tail -F ./logs/output.log;
;;
reset)
node loader --reset --$2
;;
*)
echo "Welcome to Stacktrace Storage"
echo $"Usage: $0 {start|stop|reload|restart|log}"
echo ''
column -s ' ' -t <<< '
start Start the Stacktrace Storage server
stop Stops the Stacktrace Storage server
reload Restarts Stacktrace Storage
restart Restarts Stacktrace Storage
log Opens the logging interface (useful for debugging)
'
exit 1
esac