File tree Expand file tree Collapse file tree 1 file changed +44
-2
lines changed
Expand file tree Collapse file tree 1 file changed +44
-2
lines changed Original file line number Diff line number Diff line change 33#
44# Server startscript
55#
6- # ver 2.1
6+ # ver 2.2
77#
88# ########################
99
1010WHITE=' \033[0;37m'
1111GREEN=' \033[0;32m'
1212LRED=' \033[1;31m'
1313
14+ PARAM2=$2
15+
1416# config file for wait to stop server
1517if [ -e " srv_cfg_stopsec.dat" ]; then
1618 STOPSEC=` cat srv_cfg_stopsec.dat | awk ' {print $1 }' | grep ' ^[0-9]' `
@@ -100,6 +102,41 @@ if [ -e /proc/$pid ]; then
100102fi
101103}
102104
105+ log (){
106+ if [ -e " $SZERVER .log" ]; then
107+ printf " ${GREEN} "
108+ printf " Listing actual log file:\n"
109+ case " $PARAM2 " in
110+ f)
111+ printf " Mode: follow, exit with ctrl\+c\n"
112+ printf " ${WHITE} "
113+ tail -n40 -f $SZERVER .log
114+ exit 1
115+ ;;
116+ t)
117+ printf " Mode: tail\n"
118+ printf " ${WHITE} "
119+ tail -n40 $SZERVER .log
120+ exit 1
121+ ;;
122+ * )
123+ # cat log file
124+ printf " Mode: tail\n"
125+ cat " $SZERVER .log"
126+ printf " ${WHITE} "
127+ printf " \n"
128+ ;;
129+ esac
130+
131+ else
132+ printf " ${GREEN} "
133+ printf " Error: \" $SZERVER .log\" missing.\nExiting.\n\n"
134+ printf " ${WHITE} "
135+ exit 1
136+ fi
137+ }
138+
139+
103140
104141 case " $1 " in
105142 start)
115152 debug)
116153 debug
117154 ;;
155+ log)
156+
157+ log $2
158+ ;;
118159 * )
119- printf " ${GREEN} Usage: $0 {start|stop|restart|debug}${WHITE} "
160+ printf " ${GREEN} Usage: $0 {start|stop|restart|debug|log [f|t]}\n"
161+ printf " ${WHITE} "
120162 exit 1
121163 ;;
122164
You can’t perform that action at this time.
0 commit comments