100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Minor: CI/CD host_init script bug fix (#717)
Rich Turner736f5af34595
diff --git a/.ci_cd/host_init/init.sh b/.ci_cd/host_init/init.shindex ba7ffa08c..c8e78ec4d 100644--- a/.ci_cd/host_init/init.sh+++ b/.ci_cd/host_init/init.sh@@ -17,6 +17,12 @@ elseDIR=./fi+if [ -n "$SUDO_USER" ]; then+ HOME_DIR=$(eval echo "~$SUDO_USER")+else+ HOME_DIR=~+fi+# Clean deployment persistent files if requestedif [ "$CLEAN_INSTALL" == 'true' ]; thensource "${DIR}clean.sh"@@ -26,13 +32,8 @@ fiif [ "$DAILY_RESTART" == 'true' ]; thenecho "Adding daily manager restart cron job"- username=$(id -u -n)- if [ -n "$SUDO_USER" ]; then- username=$SUDO_USER- fi- dir=~echo '#!/bin/bash' > /etc/cron.d/or-restart- echo "0 5 * * * $username $dir/temp/host_init/restart.sh" >> /etc/cron.d/or-restart+ echo "0 5 * * * root $HOME_DIR/temp/host_init/restart.sh" >> /etc/cron.d/or-restartelseecho "Removing any existing daily restart cron job"rm -f /etc/cron.d/or-restart &>/dev/null@@ -41,15 +42,8 @@ fiif [ "$DAILY_BACKUP" != 'false' ]; thenecho "Adding daily backup cron job"- username=$(id -u -n)- if [ -n "$SUDO_USER" ]; then- dir=$(eval echo "~$SUDO_USER")- else- dir=~- fi-echo '#!/bin/bash' > /etc/cron.d/or-backup- echo "0 4 * * * root $dir/temp/host_init/backup.sh" >> /etc/cron.d/or-backup+ echo "0 4 * * * root $HOME_DIR/temp/host_init/backup.sh" >> /etc/cron.d/or-backupelseecho "Removing any existing daily backup cron job"rm -f /etc/cron.d/or-backup &>/dev/null