forked from sujune/bwc-installer
Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
이수준 | 79df823dbd | |
이수준 | 551820ac98 | |
이수준 | ce3511c89e |
Binary file not shown.
|
@ -0,0 +1,10 @@
|
||||||
|
[Unit]
|
||||||
|
Description=When change project code, it manage blokwork clients.
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/local/bin/bwc-management -mqtt=aws
|
||||||
|
Restart=always
|
||||||
|
RestartSec=10
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
sudo cp bwc-management /usr/local/bin/
|
||||||
|
sudo cp bwc-management.service /etc/systemd/system/
|
||||||
|
sudo systemctl start bwc-management
|
||||||
|
sudo systemctl enable bwc-management
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"assetcode": "acode",
|
||||||
|
"devicetype": "typecode",
|
||||||
|
"mqtturl": "tcp://43.200.53.170:32259",
|
||||||
|
"projectcode": "no_project",
|
||||||
|
"reboot": "",
|
||||||
|
"requestid": ""
|
||||||
|
}
|
|
@ -1,3 +0,0 @@
|
||||||
assetcode: acode
|
|
||||||
devicetype: typecode
|
|
||||||
mqtturl: tcp://13.209.39.139:32259
|
|
Binary file not shown.
|
@ -1,8 +1,8 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=device-control
|
Description=It control device. There are device's bash, systemd, app's management, json edit.
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/local/bin/device-control
|
ExecStart=/usr/local/bin/device-control -mqtt=aws
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
sudo mkdir -p /etc/sdt/device-control
|
# sudo mkdir -p /etc/sdt/device.config
|
||||||
sudo cp config.yaml /etc/sdt/device-control
|
sudo cp config.json /etc/sdt/device.config/config.json
|
||||||
sudo sed -i "s/acode/$1/g" /etc/sdt/device-control/config.yaml
|
sudo sed -i "s/acode/$1/g" /etc/sdt/device.config/config.json
|
||||||
sudo sed -i "s/typecode/$2/g" /etc/sdt/device-control/config.yaml
|
sudo sed -i "s/typecode/$2/g" /etc/sdt/device.config/config.json
|
||||||
sudo cp device-control /usr/local/bin/
|
sudo cp device-control /usr/local/bin/
|
||||||
sudo cp device-control.service /etc/systemd/system/
|
sudo cp device-control.service /etc/systemd/system/
|
||||||
sudo systemctl start device-control
|
sudo systemctl start device-control
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
assetcode: acode
|
|
||||||
mqtturl: tcp://13.209.39.139:32259
|
|
Binary file not shown.
|
@ -1,9 +1,9 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=DeviceHealth
|
Description=It get device's health. There is cpu, memory, network up/downlink, network interface, etc.
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=root
|
User=root
|
||||||
ExecStart=/usr/local/bin/device-health
|
ExecStart=/usr/local/bin/device-health -mqtt=aws
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
sudo mkdir -p /etc/sdt/device-health
|
# sudo mkdir -p /etc/sdt/device-health
|
||||||
sudo cp config.yaml /etc/sdt/device-health/
|
|
||||||
sudo sed -i "s/acode/$1/g" /etc/sdt/device-health/config.yaml
|
|
||||||
sudo cp device-health /usr/local/bin/
|
sudo cp device-health /usr/local/bin/
|
||||||
sudo cp device-health.service /etc/systemd/system/
|
sudo cp device-health.service /etc/systemd/system/
|
||||||
sudo systemctl start device-health
|
sudo systemctl start device-health
|
||||||
|
|
Binary file not shown.
|
@ -1,9 +1,9 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=DeviceHearthBeat
|
Description=It send heatbeat to BlokWorks.
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=root
|
User=root
|
||||||
ExecStart=/usr/local/bin/device-heartbeat
|
ExecStart=/usr/local/bin/device-heartbeat -mqtt=aws
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# sudo mkdir -p /etc/sdt/device-heartbeat
|
||||||
sudo cp device-heartbeat /usr/local/bin/
|
sudo cp device-heartbeat /usr/local/bin/
|
||||||
sudo cp device-heartbeat.service /etc/systemd/system/
|
sudo cp device-heartbeat.service /etc/systemd/system/
|
||||||
sudo systemctl start device-heartbeat
|
sudo systemctl start device-heartbeat
|
||||||
|
|
19
init.sh
19
init.sh
|
@ -5,10 +5,11 @@ set -e
|
||||||
if [ $(id -u) -ne 0 ]; then
|
if [ $(id -u) -ne 0 ]; then
|
||||||
echo "Please run as root. - sudo su"
|
echo "Please run as root. - sudo su"
|
||||||
exit
|
exit
|
||||||
elif [ $1 == "help" ]; then
|
else
|
||||||
echo "Please input parameter. follow as:"
|
echo "Please input parameter. follow as:"
|
||||||
echo "Example) Organzation ID=58a311aa-f52a-40e3-af44-cdec82b9d0b7 SerialNumbe=ECN-SJ-TEST-001 Type=ecn"
|
echo "Organzation ID=58a311aa-f52a-40e3-af44-cdec82b9d0b7"
|
||||||
exit
|
echo "SerialNumber=ECN-SJ-TEST-001"
|
||||||
|
echo "Type=ecn"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "If you need help, please enter follow as:"
|
echo "If you need help, please enter follow as:"
|
||||||
|
@ -17,6 +18,11 @@ read -p "Organzation ID(58a311aa-f52a-40e3-af44-cdec82b9d0b7): " oid
|
||||||
read -p "Serial Number(ECN-SJ-TEST-001): " acode
|
read -p "Serial Number(ECN-SJ-TEST-001): " acode
|
||||||
read -p "Type(ecn or nodeq): " etype
|
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"
|
echo "[INIT] [1] Start equipment registration"
|
||||||
./bwc-init -oid=$oid -acode=$acode
|
./bwc-init -oid=$oid -acode=$acode
|
||||||
echo "[INIT] [1] Finish equipment registration"
|
echo "[INIT] [1] Finish equipment registration"
|
||||||
|
@ -40,4 +46,9 @@ echo "[INIT] [4] Finish install device-heartbeat"
|
||||||
echo "[INIT] [5] Start install process-checker"
|
echo "[INIT] [5] Start install process-checker"
|
||||||
cd ../process-checker
|
cd ../process-checker
|
||||||
./install.sh
|
./install.sh
|
||||||
echo "[INIT] [5] Stop install process-checker"
|
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"
|
|
@ -1,5 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# sudo mkdir -p /etc/sdt/process-checker
|
||||||
sudo cp process-checker /usr/local/bin/
|
sudo cp process-checker /usr/local/bin/
|
||||||
sudo cp process-checker.service /etc/systemd/system/
|
sudo cp process-checker.service /etc/systemd/system/
|
||||||
sudo systemctl start process-checker
|
sudo systemctl start process-checker
|
||||||
|
|
Binary file not shown.
|
@ -1,9 +1,9 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=processchecker
|
Description=It get app's health. There is cpu, memory, app's PID, app's status.
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=root
|
User=root
|
||||||
ExecStart=/usr/local/bin/process-checker
|
ExecStart=/usr/local/bin/process-checker -mqtt=aws
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
|
|
||||||
|
|
11
uninstall.sh
11
uninstall.sh
|
@ -37,5 +37,12 @@ rm /etc/systemd/system/process-checker.service
|
||||||
rm /usr/local/bin/process-checker
|
rm /usr/local/bin/process-checker
|
||||||
echo "[INIT] Finish uninstall process-checker"
|
echo "[INIT] Finish uninstall process-checker"
|
||||||
|
|
||||||
echo "[INIT] Delete Cert Data"
|
echo "[INIT] Start uninstall bwc-management"
|
||||||
rm -rf /etc/sdt/cert
|
systemctl disable bwc-management
|
||||||
|
systemctl stop bwc-management
|
||||||
|
rm /etc/systemd/system/bwc-management.service
|
||||||
|
rm /usr/local/bin/bwc-management
|
||||||
|
echo "[INIT] Finish uninstall bwc-management"
|
||||||
|
|
||||||
|
echo "[INIT] Delete Cert, Config, Log Data"
|
||||||
|
rm -rf /etc/sdt
|
Loading…
Reference in New Issue