aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-extended/webmin
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-extended/webmin')
-rw-r--r--recipes-extended/webmin/webmin-notice/webmin-notice.sh42
-rw-r--r--recipes-extended/webmin/webmin-notice_1.0.bb21
2 files changed, 63 insertions, 0 deletions
diff --git a/recipes-extended/webmin/webmin-notice/webmin-notice.sh b/recipes-extended/webmin/webmin-notice/webmin-notice.sh
new file mode 100644
index 0000000..fa493ef
--- /dev/null
+++ b/recipes-extended/webmin/webmin-notice/webmin-notice.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+# Webmin connect info report script
+# Copyright (C) 2011 Intel Corporation
+# Distributed under the MIT license
+
+if ! [ -f /var/webmin/miniserv.pid ] ; then
+ echo "Webmin not started or failed to start"
+ exit
+elif ! [ -d /proc/`cat /var/webmin/miniserv.pid` ] ; then
+ echo "Webmin not started or failed to start"
+ exit
+fi
+
+if [ "`pidof avahi-daemon`" != "" ] ; then
+ host=`grep "^host-name=" /etc/avahi/avahi-daemon.conf | sed 's/host-name=//'`
+ if [ "$host" = "" ] ; then
+ host=`hostname`
+ fi
+ domain=`grep "^domain-name=" /etc/avahi/avahi-daemon.conf | sed 's/domain-name=//'`
+ if [ "$domain" = "" ] ; then
+ domain="local"
+ fi
+ avahiaddr="$host.$domain"
+fi
+
+port=`grep "^port=" /etc/webmin/miniserv.conf | sed 's/port=//'`
+ssl=`grep "^ssl=" /etc/webmin/miniserv.conf | sed 's/ssl=//'`
+if [ "$ssl" = "1" ] ; then
+ proto="https"
+else
+ proto="http"
+fi
+ipaddr=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
+
+addr="$proto://$ipaddr:$port"
+if [ "$avahiaddr" != "" ] ; then
+ addr="$proto://$avahiaddr:$port or $addr"
+fi
+echo
+echo "Web administration interface is now available at:"
+echo " $addr"
+
diff --git a/recipes-extended/webmin/webmin-notice_1.0.bb b/recipes-extended/webmin/webmin-notice_1.0.bb
new file mode 100644
index 0000000..623bda0
--- /dev/null
+++ b/recipes-extended/webmin/webmin-notice_1.0.bb
@@ -0,0 +1,21 @@
+DESCRIPTION = "Web administration notice script"
+LICENSE = "MIT"
+SRC_URI = "file://webmin-notice.sh"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
+RDEPENDS_${PN} = "webmin"
+
+inherit allarch update-rc.d
+
+INITSCRIPT_NAME = "webmin-notice"
+INITSCRIPT_PARAMS = "start 99 5 3 ."
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${sysconfdir}
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 webmin-notice.sh ${D}${sysconfdir}/init.d/webmin-notice
+}
+
+# No sundry packages
+PACKAGES = "${PN}"