Initial add-on code

This commit is contained in:
Franck Nijhof 2018-05-22 21:29:22 +02:00
parent 621cdfb0ea
commit e853ef30b3
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3
23 changed files with 1069 additions and 0 deletions

View file

@ -0,0 +1,36 @@
#!/usr/bin/with-contenv bash
# ==============================================================================
# Community Hass.io Add-ons: SonWEB
# Applies patch to remove SelfUpdate, since that is useless shit in Docker
# ==============================================================================
# shellcheck disable=SC1091
source /usr/lib/hassio-addons/base.sh
patch -F2 -R --ignore-whitespace /var/www/sonweb/includes/header.php <<'PATCH'
--- header.php 2018-05-22 00:00:00.463304792 +0200
+++ header.php 2018-05-22 00:00:00.291634513 +0200
@@ -178,6 +178,15 @@
</li>
<?php endif; ?>
+ <?php if ( $loggedin ): ?>
+ <li class="nav-item">
+ <a class="nav-link <?php echo $page == "selfupdate" ? "active" : ""; ?>"
+ href='<?php echo _BASEURL_; ?>selfupdate'>
+ <?php echo __( "SELFUPDATE", "NAVI" ); ?>
+ </a>
+ </li>
+ <?php endif; ?>
+
</ul>
PATCH
# shellcheck disable=SC2181
if [[ "$?" -ne 0 ]];
then
hass.die 'Patching SonWEB SelfUpdate failed'
fi
hass.log.debug 'Applied SonWEB SelfUpdate fix'