optimized logging

This commit is contained in:
buanet
2019-03-14 13:54:44 +01:00
parent 672bca2630
commit 83f3542f68

View File

@@ -4,13 +4,19 @@
packages=$PACKAGES
avahi=$AVAHI
# Version output for logging
echo 'Version: 2.0.5beta'
# Information
echo ''
echo '----------------------------------------'
echo '----- Image-Version: 2.0.5beta -----'
echo '----- $(date '+%Y-%m-%d %H:%M:%S') -----'
echo '----------------------------------------'
echo ''
echo 'Startupscript running...'
# Checking and installing additional packages
if [ "$packages" != "" ]
then
echo ''
echo 'Installing additional packages...'
echo 'The following packages will be installed:' $packages
sudo echo $packages > /opt/scripts/.packages
@@ -23,6 +29,7 @@ cd /opt/iobroker
# Checking and restoring ioBroker to mounted folder
if [ `ls -1a|wc -l` -lt 3 ]
then
echo ''
echo 'Directory /opt/iobroker is empty!'
echo 'Restoring...'
sudo tar -xf /opt/initial_iobroker.tar -C /
@@ -32,6 +39,7 @@ fi
# Checking for first run and renaming ioBroker
if [ -f /opt/iobroker/.install_host ]
then
echo ''
echo 'First run preparation! Used Hostname:' $(hostname)
echo 'Renaming ioBroker...'
iobroker host $(cat /opt/iobroker/.install_host)
@@ -42,6 +50,7 @@ fi
# Checking and setting up avahi-daemon
if [ "$avahi" = "true" ]
then
echo ''
echo 'Initializing Avahi-Daemon...'
sudo sh /opt/scripts/avahi_startup.sh
echo 'Initializing Avahi-Daemon done...'
@@ -50,6 +59,7 @@ fi
sleep 5
# Starting ioBroker
echo ''
echo 'Starting ioBroker...'
sudo node node_modules/iobroker.js-controller/controller.js > /opt/scripts/iobroker.log 2>&1 &
echo 'Starting ioBroker done...'