Initial import

This commit is contained in:
belliash
2013-08-14 13:56:12 +02:00
parent f392b8ef47
commit 9318b5b444
45 changed files with 1687 additions and 4 deletions

8
files/etc/config/kagera Normal file
View File

@@ -0,0 +1,8 @@
config webui webui
option protocol "http"
option http_port "80"
option https_port "443"
option multimenu "1"
option language "english"
option theme "kagera"
option timeout "15"

33
files/etc/init.d/webui Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/sh /etc/rc.common
START=51
PID_HTTP=/var/run/webui-http.pid
PID_HTTPS=/var/run/webui-https.pid
start() {
config_load "kagera"
config_get CERT_FILE "webui" cert_file
config_get HTTP_PORT "webui" http_port
config_get HTTPS_PORT "webui" https_port
config_get UI_LANG "webui" language
config_get PROTOCOL "webui" protocol
[ -z "$CERT_FILE" ] && CERT_FILE="/usr/lib/kagera/kagera.pem"
[ -z "$HTTP_PORT" ] && HTTP_PORT="80"
[ -z "$HTTPS_PORT" ] && HTTPS_PORT="443"
[ -z "$UI_LANG" ] && UI_LANG="english"
[ -z "$PROTOCOL" ] && PROTOCOL="http"
if [ "$PROTOCOL" == "http" ]; then
kuhttpd -d "/usr/lib/kagera/webui" -i "$PID_HTTP" -p "$HTTP_PORT" -L "$UI_LANG" 2>/dev/null
elif [ "$PROTOCOL" == "https" ]; then
kuhttpd -d "/usr/lib/kagera/webui" -i "$PID_HTTPS" -p "$HTTPS_PORT" -S -E "$CERT_FILE" -L "$UI_LANG" 2>/dev/null
else
kuhttpd -d "/usr/lib/kagera/webui" -i "$PID_HTTPS" -p "$HTTP_PORT" -SP "$HTTPS_PORT" -S -E "$CERT_FILE" -L "$UI_LANG" 2>/dev/null
fi
}
stop() {
[ -f "$PID_HTTP" ] && kill "$(cat $PID_HTTP)" 2>/dev/null
[ -f "$PID_HTTPS" ] && kill "$(cat $PID_HTTPS)" 2>/dev/null
}