bwc-installer-arm32/init.sh

55 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
set -e
if [ $(id -u) -ne 0 ]; then
echo "Please run as root. - sudo su"
exit
else
echo "Please input parameter. follow as:"
echo "Organzation ID=58a311aa-f52a-40e3-af44-cdec82b9d0b7"
echo "SerialNumber=ECN-SJ-TEST-001"
echo "Type=ecn"
fi
mkdir -p /usr/local/bin
echo "If you need help, please enter follow as:"
echo "./init.sh help"
read -p "Organzation ID(58a311aa-f52a-40e3-af44-cdec82b9d0b7): " oid
read -p "Serial Number(ECN-SJ-TEST-001): " acode
read -p "Type(ecn or nodeq): " etype
echo "[INIT] [0] Init equipment registration"
mkdir -p /etc/sdt/device.config
mkdir -p /etc/sdt/device.logs
echo "[INIT] [0] Finish init equipment registration"
echo "[INIT] [1] Start equipment registration"
./bwc-init -oid=$oid -acode=$acode
echo "[INIT] [1] Finish equipment registration"
echo "[INIT] [2] Start install device-control"
cd device-control
./install.sh $acode $etype
mkdir -p /usr/local/sdt/app
echo "[INIT] [2] Finish install device-control"
echo "[INIT] [3] Start install device-health"
cd ../device-health
./install.sh $acode
echo "[INIT] [3] Finish install device-health"
echo "[INIT] [4] Start install device-heartbeat"
cd ../heartbeat
./install.sh
echo "[INIT] [4] Finish install device-heartbeat"
echo "[INIT] [5] Start install process-checker"
cd ../process-checker
./install.sh
echo "[INIT] [5] Stop install process-checker"
echo "[INIT] [6] Start install bwc-management"
cd ../bwc-management
./install.sh
echo "[INIT] [6] Stop install bwc-management"