-
Notifications
You must be signed in to change notification settings - Fork 0
/
RRDTool_API.bash
executable file
·48 lines (39 loc) · 1.21 KB
/
RRDTool_API.bash
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
#!/bin/bash
#h-------------------------------------------------------------------------------
#h
#h Name: RRDTool_API.bash
#h Type: Linux shell script
#h Purpose: start flask/ rest_api for RRDTool database
#h Project:
#h Usage: ./RRDTool_API.bash
#h Result:
#h Examples:
#h Outline:
#h Resources:
#h Platforms: Linux
#h Authors: peb piet66
#h Version: V1.0.0 2023-01-04/peb
#v History: V1.0.0 2022-03-14/peb first version
#h Copyright: (C) piet66 2022
#h License: http://opensource.org/licenses/MIT
#h
#h-------------------------------------------------------------------------------
MODULE='RRDTool_API.bash';
VERSION='V1.0.0'
WRITTEN='2023-01-04/peb'
# exit when any command fails
set -e
#set path constants
. `dirname $(readlink -f $0)`/00_constants >/dev/null
### uncomment this line for debug messages (single threaded)
#export FLASK_ENV=development
### define application
export FLASK_APP=$PACKET_NAME.py
### for change the default port 5000
export FLASK_RUN_PORT=$PORT
### listen for remote packets
export FLASK_RUN_HOST=0.0.0.0 # ipv4
#export FLASK_RUN_HOST=:: # ipv6
### run
LOG=$LOG_PATH/${PACKET_NAME}.log
flask run >>$LOG 2>&1