enhance logging for avahi & zwave install scripts

This commit is contained in:
buanet
2022-06-15 09:45:28 +02:00
parent de25659bcd
commit 2051a788aa
6 changed files with 33 additions and 33 deletions

View File

@@ -3,6 +3,7 @@
* rewrite maintenance script ([#243 by @agross](https://github.com/buanet/ioBroker.docker/pull/243)) * rewrite maintenance script ([#243 by @agross](https://github.com/buanet/ioBroker.docker/pull/243))
* enhance container shutdown on SIGTERM ([as requested with #264 by @buzz0r](https://github.com/buanet/ioBroker.docker/pull/264)) * enhance container shutdown on SIGTERM ([as requested with #264 by @buzz0r](https://github.com/buanet/ioBroker.docker/pull/264))
* enhance startup script logging * enhance startup script logging
* enhance logging for avahi & zwave install scripts
### v6.1.0 (2022-03-01) ### v6.1.0 (2022-03-01)
* v6.1.0-beta.2 (2022-02-11) * v6.1.0-beta.2 (2022-02-11)

View File

@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2017-2021 André Germann Copyright (c) 2017-2022 André Germann
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -77,7 +77,7 @@ Moved to [CHANGELOG.md](CHANGELOG.md).
MIT License MIT License
Copyright (c) 2017-2021 André Germann Copyright (c) 2017-2022 André Germann
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -86,7 +86,7 @@ then
bash /opt/scripts/setup_packages.sh -update bash /opt/scripts/setup_packages.sh -update
echo "Done." echo "Done."
echo ' ' echo ' '
echo "Registering maintenance script as command..." echo -n "Registering maintenance script as command... "
echo "alias maintenance=\'/opt/scripts/maintenance.sh\'" >> /root/.bashrc echo "alias maintenance=\'/opt/scripts/maintenance.sh\'" >> /root/.bashrc
echo "alias maint=\'/opt/scripts/maintenance.sh\'" >> /root/.bashrc echo "alias maint=\'/opt/scripts/maintenance.sh\'" >> /root/.bashrc
echo "alias m=\'/opt/scripts/maintenance.sh\'" >> /root/.bashrc echo "alias m=\'/opt/scripts/maintenance.sh\'" >> /root/.bashrc
@@ -240,7 +240,6 @@ then
echo "Avahi-daemon is activated by ENV." echo "Avahi-daemon is activated by ENV."
chmod 755 /opt/scripts/setup_avahi.sh chmod 755 /opt/scripts/setup_avahi.sh
bash /opt/scripts/setup_avahi.sh bash /opt/scripts/setup_avahi.sh
echo "Done."
echo ' ' echo ' '
fi fi
fi fi
@@ -253,7 +252,6 @@ then
echo "Z-Wave is activated by ENV." echo "Z-Wave is activated by ENV."
chmod 755 /opt/scripts/setup_zwave.sh chmod 755 /opt/scripts/setup_zwave.sh
bash /opt/scripts/setup_zwave.sh bash /opt/scripts/setup_zwave.sh
echo "Done."
echo ' ' echo ' '
fi fi
fi fi
@@ -502,7 +500,7 @@ shut_down() {
if (($(date +%s) > timeout)); then if (($(date +%s) > timeout)); then
echo -e '\nTimeout reached. Killing remaining processes...' echo -e '\nTimeout reached. Killing remaining processes...'
pkill --signal SIGKILL -u iobroker pkill --signal SIGKILL -u iobroker
echo 'Done.' echo 'Done. Have a nice day!'
exit exit
fi fi
@@ -510,7 +508,7 @@ shut_down() {
sleep 1 sleep 1
done done
echo -e '\nDone.' echo -e '\nDone. Have a nice day!'
exit exit
} }

View File

@@ -1,19 +1,20 @@
#!/bin/bash #!/bin/bash
echo "Checking avahi-daemon installation state..."
if [ -e /usr/sbin/avahi-daemon ] && [ -e /var/run/dbus ] if [ -e /usr/sbin/avahi-daemon ] && [ -e /var/run/dbus ]
then then
echo "Avahi is already installed..." echo 'Avahi is already installed. Nothing to do here.'
else else
echo "Avahi-daemon is NOT installed. Going to install it now..." echo -n 'Avahi-daemon is NOT installed. Going to install it now... '
apt-get update > /opt/scripts/avahi_startup.log 2>&1 apt-get update > /opt/scripts/avahi_startup.log 2>&1
apt-get install -y libavahi-compat-libdnssd-dev avahi-daemon >> /opt/scripts/avahi_startup.log 2>&1 apt-get install -y libavahi-compat-libdnssd-dev avahi-daemon >> /opt/scripts/avahi_startup.log 2>&1
rm -rf /var/lib/apt/lists/* >> /opt/scripts/avahi_startup.log 2>&1 rm -rf /var/lib/apt/lists/* >> /opt/scripts/avahi_startup.log 2>&1
echo "Configuring avahi-daemon..." echo 'Done.'
sed -i '/^rlimit-nproc/s/^\(.*\)/#\1/g' /etc/avahi/avahi-daemon.conf echo -n 'Configuring avahi-daemon... '
echo "Configuring dbus..." sed -i '/^rlimit-nproc/s/^\(.*\)/#\1/g' /etc/avahi/avahi-daemon.conf
mkdir /var/run/dbus/ echo 'Done.'
echo -n 'Configuring dbus... '
mkdir /var/run/dbus/
echo 'Done.'
fi fi
if [ -f /var/run/dbus/pid ]; if [ -f /var/run/dbus/pid ];
@@ -26,10 +27,12 @@ then
rm -f /var/run/avahi-daemon//pid rm -f /var/run/avahi-daemon//pid
fi fi
echo "Starting dbus..." echo -n "Starting dbus... "
dbus-daemon --system dbus-daemon --system >> /opt/scripts/avahi_startup.log 2>&1
echo 'Done.'
echo "Starting avahi-daemon..." echo -n "Starting avahi-daemon... "
/etc/init.d/avahi-daemon start /etc/init.d/avahi-daemon start >> /opt/scripts/avahi_startup.log 2>&1
echo 'Done.'
exit 0 exit 0

View File

@@ -1,19 +1,17 @@
#!/bin/bash #!/bin/bash
echo "Checking openzwave installation state..."
if [ -e /usr/local/lib64 ] if [ -e /usr/local/lib64 ]
then then
echo "Openzwave is already installed..." echo 'Openzwave is already installed. Nothing to do here.'
else else
echo "Openzwave is NOT installed. Going to install it now..." echo -n 'Openzwave is NOT installed. Going to install it now... '
cd /opt cd /opt
curl -s -L -O http://old.openzwave.com/downloads/openzwave-1.6.1007.tar.gz curl -s -L -O http://old.openzwave.com/downloads/openzwave-1.6.1007.tar.gz
tar -xf openzwave-1.6.1007.tar.gz && rm openzwave-1.6.1007.tar.gz tar -xf openzwave-1.6.1007.tar.gz && rm openzwave-1.6.1007.tar.gz
cd openzwave-1.6.1007 && make > /dev/null 2>&1 && make install > /dev/null 2>&1 cd openzwave-1.6.1007 && make > /dev/null 2>&1 && make install > /dev/null 2>&1
ldconfig /usr/local/lib64 ldconfig /usr/local/lib64
cd /opt/iobroker cd /opt/iobroker
# echo "Openzwave is now installed..." echo 'Done.'
fi fi
exit 0 exit 0