1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
|
3 |
MCLIBDIR="/usr/lib/mcored" |
MCLIBDIR="@@MCLIBDIR@@" |
4 |
|
|
5 |
|
# respect system env (proxy settings etc) |
6 |
|
if [ -e @@ETCDIR@@/profile ] |
7 |
|
then |
8 |
|
source @@ETCDIR@@/profile |
9 |
|
fi |
10 |
|
|
11 |
# globals |
# globals |
12 |
source ${MCLIBDIR}/include/daemon.global.class |
source ${MCLIBDIR}/include/daemon.global.class |
18 |
load_client_classes |
load_client_classes |
19 |
|
|
20 |
# config settings |
# config settings |
21 |
source /etc/mcore/config.rc |
source @@ETCDIR@@/mcore/config.rc |
22 |
#source /etc/mcore/serial |
#source @@ETCDIR@@/mcore/serial |
23 |
|
|
24 |
# import_hardware_resource() |
# import_hardware_resource() |
25 |
# { |
# { |
58 |
run=run |
run=run |
59 |
valid_session=no |
valid_session=no |
60 |
|
|
61 |
|
# tell what we are |
62 |
|
echo "Connected to $(print_version)" |
63 |
|
|
64 |
while [[ ${run} = run ]] |
while [[ ${run} = run ]] |
65 |
do |
do |
66 |
read line |
read line |
79 |
restart) valid_session && restart_service ;; |
restart) valid_session && restart_service ;; |
80 |
stop) valid_session && stop_service ;; |
stop) valid_session && stop_service ;; |
81 |
nocolors) export NOCOLORS="true" ;; |
nocolors) export NOCOLORS="true" ;; |
82 |
|
colors) export NOCOLORS="false" ;; |
83 |
webcrlf) export WEBCRLF="true" ;; |
webcrlf) export WEBCRLF="true" ;; |
84 |
quiet) export QUIET="true" ;; |
quiet) export QUIET="true" ;; |
85 |
|
# version does not need auth |
86 |
|
version) print_version ;; |
87 |
help*) |
help*) |
88 |
if valid_session |
if valid_session |
89 |
then |
then |