Added i2c-amp-control service
This commit is contained in:
17
i2c-amp-control/install.sh
Normal file
17
i2c-amp-control/install.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
npm i
|
||||
|
||||
SERVICE="i2c-amp-control"
|
||||
SERVICE_FOLDER="/data/services/$SERVICE"
|
||||
mkdir -p "$SERVICE_FOLDER"
|
||||
cp ./index.js "$SERVICE_FOLDER"
|
||||
cp -r ./node_modules "$SERVICE_FOLDER"
|
||||
|
||||
cp $SERVICE.service /etc/systemd/system
|
||||
if systemctl list-units | grep "$SERVICE"; then
|
||||
systemctl restart "$SERVICE.service"
|
||||
echo "$SERVICE service restarted"
|
||||
else
|
||||
systemctl enable "$SERVICE.service"
|
||||
systemctl start "$SERVICE.service"
|
||||
echo "Enabled and started $SERVICE"
|
||||
fi
|
||||
Reference in New Issue
Block a user