Skip to content
Snippets Groups Projects
Commit cf7bbeec authored by Bob Mottram's avatar Bob Mottram
Browse files

Setup web admin within avahi

parent bad0dd56
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,23 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
function web_admin_avahi {
{ echo '<?xml version="1.0" standalone="no"?><!--*-nxml-*-->';
echo '<!DOCTYPE service-group SYSTEM "avahi-service.dtd">';
echo '<service-group>';
echo ' <name replace-wildcards="yes">%h http</name>';
echo ' <service>';
echo ' <type>_http._tcp</type>';
echo ' <port>80</port>';
echo ' </service>';
echo ' <service>';
echo ' <type>_https._tcp</type>';
echo ' <port>443</port>';
echo ' </service>';
echo '</service-group>'; } > /etc/avahi/services/webadmin.service
systemctl restart avahi-daemon
}
function web_admin_create_installed_apps {
local_hostname=$(grep 'host-name' /etc/avahi/avahi-daemon.conf | awk -F '=' '{print $2}').local
appslist_template_filename="/var/www/${local_hostname}/htdocs/admin/apps_template.html"
......@@ -247,6 +264,8 @@ function install_web_admin {
web_admin_create_installed_apps
chown -R www-data:www-data "/var/www/${local_hostname}/htdocs"
web_admin_avahi
}
# NOTE: deliberately no exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment