- # NOTE: call create_all() to setup the database from the info model.
- python -c "from monitor.database.info.model import *; from elixir import create_all; create_all()"
- $MONITORPATH/init-bootman-sequence.py
+ pattern=$1
+ with=$2
+ file=$3
+ sed -i -e "s/$pattern/$with/g" $file
+}
+function apply_template ()
+{
+ TEMPLATE=$1
+ DESTFILE=$2
+
+ tmp_file=$(mktemp)
+ cp $TEMPLATE $tmp_file
+
+ update_config PLC_NAME "$PLC_NAME" $tmp_file
+ update_config PLC_WWW_HOSTNAME $PLC_WWW_HOST $tmp_file
+ update_config MONITOR_HOSTNAME $PLC_MONITOR_HOST $tmp_file
+
+ cp $tmp_file $DESTFILE
+ rm -f $tmp_file
+}
+
+function check_gadget_config ()
+{
+ for input_file in $MONITORPATH/$WEB_ROOT_PATH/$WEB_XML_PATH/*.in ; do
+ output_file=$MONITORPATH/$WEB_ROOT_PATH/$WEB_XML_PATH/`basename $input_file | sed -e 's/.in\$//'`
+ if [ $input_file -nt $output_file ] ; then
+ apply_template $input_file $output_file
+ fi
+ done
+}
+
+function check_monitor_schema_and_data_init()
+{
+ # from monitor.functions
+ check_monitor_schema_and_data
+
+ $MONITORPATH/config.d/init-bootman-sequence.py