pax_global_header00006660000000000000000000000064126026026440014514gustar00rootroot0000000000000052 comment=2cdf52b3692d199b450db4b5b0c53150803b4137
bosixnet-1.7/000077500000000000000000000000001260260264400132165ustar00rootroot00000000000000bosixnet-1.7/.gitignore000066400000000000000000000000121260260264400151770ustar00rootroot00000000000000builddir*
bosixnet-1.7/CMakeLists.txt000066400000000000000000000010351260260264400157550ustar00rootroot00000000000000project (bosixnet)
cmake_minimum_required (VERSION 2.8)
set (PROJECT_NAME "BOSixNet")
set (VERSION "1.7")
add_subdirectory (src/bosixnet-daemon)
add_subdirectory (src/bosixnet-webui)
configure_file (${PROJECT_SOURCE_DIR}/Version.h.in ${PROJECT_BINARY_DIR}/Version.h)
add_custom_target (uninstall
COMMAND xargs -a "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt" rm
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/src/bosixnet-daemon/bosixnet-daemon remove
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/src/bosixnet-webui/bosixnet-webui remove)
bosixnet-1.7/INSTALL000066400000000000000000000014421260260264400142500ustar00rootroot00000000000000*** Build dependencies ***
gcc (>= 4.8) or clang (>= 3.2)
libfcgi-dev (>= 2.4)
cmake (>= 2.8)
gzip
*** Runtime dependencies ***
libfcgi -- Shared library of FastCGI
spawn-fcgi -- A fastcgi process spawner
curl -- Сommand line tool for transferring data with URL syntax
sed -- The GNU sed stream editor
*** Recommended programs ***
miredo -- Teredo IPv6 tunneling through NATs
gogoc -- Client to connect to IPv6 tunnel brokers
You do not need any of these programs if your Internet provider gives you
direct access to IPv6 network. Unfortunately this is too rare situation now.
*** Build ***
mkdir -p builddir
cd builddir
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
make
sudo make install
*** Build options ***
-DCMAKE_BUILD_TYPE={Release, RelWithDebInfo, Debug, MinRelSize}
bosixnet-1.7/LICENSE000066400000000000000000000020661260260264400142270ustar00rootroot00000000000000Copyright (c) 2013-2015 Boris Pek
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
bosixnet-1.7/README000066400000000000000000000072561260260264400141100ustar00rootroot00000000000000BOSixNet -- Build Own IPv6 Network
Copyright: 2013-2015 Boris Pek
License: Expat
Homepage: https://github.com/tehnick/bosixnet
Deb packages:
https://github.com/tehnick/bosixnet-debian
https://launchpad.net/~tehnick/+archive/bosixnet
Description:
Project should be useful when you have to administer many computers
distributed through different networks and connected via NAT. In most of cases
you may just install miredo, gogoc or any other tunnel broker's software and
these computers will be available via IPv6 addresses. BOSixNet includes the
collection of tools for automatic updating the list of such hosts.
Project consist of two parts:
1) bosixnet-webui -- FastCGI program which passively listens for incoming
connections and generates list of hosts in your IPv6 network. This daemon
prepares data which may be put directly into /etc/hosts.
2) bosixnet-daemon -- shell script which periodically sends information about
current IPv6 address to remote server and updates local /etc/hosts based on
data received from that remote server. It is expected that bosixnet-webui
is launched on that remote server.
For building own IPv6 network you need to install miredo, gogoc or any other
tunnel broker software on all hosts where bosixnet-daemon will be launched.
Of course you do not need any of these programs if your Internet provider
gives you direct access to IPv6 network. Unfortunately this is too rare
situation now.
There are few possible solutions for remote server with bosixnet-webui:
1) Fixed IPv4 or IPv6 address. But if you have statical IP you may use other
solutions (like VPN) and this project is not very useful in such case.
2) Dynamic IPv4 address + fixed domain name. For example, you may any DDNS
provider.
3) Dynamic IPv6 address + fixed domain name. Some tunnel brokers give special
domain names for their clients. For example, if you are registered on
Freenet6 and use gogoc, you will have domain name like:
.broker.freenet6.net
4) etc.
bosixnet-webui is a small program with very few dependencies. It may be easily
launched on embedded devices.
Important notes:
1) In almost all cases the speed of access via teredo is much better than via
tunnel brokers. Also miredo is very easy in use.
2) If two computers are in the same LAN, direct connection via teredo is not
possible between them. So at least one of them should use tunnel broker.
Some useful links:
https://en.wikipedia.org/wiki/IPv6
https://en.wikipedia.org/wiki/Teredo_tunneling
https://en.wikipedia.org/wiki/Miredo
https://github.com/jorti/gogoc
Examples of using Web UI:
http://ipv6.example.com/bosixnet/main-laptop?update=2001:0:53aa:64c:2f53:5e65:9258:72de
http://ipv6.example.com/bosixnet/main-laptop
http://ipv6.example.com/bosixnet/home-pc?update=2001:0:53aa:64c:3574:128e:9291:a021
http://ipv6.example.com/bosixnet/home-pc
http://ipv6.example.com/bosixnet/wife-netbook?update=2001:0:53aa:64c:26e0:3bf2:9258:72de
http://ipv6.example.com/bosixnet/wife-netbook
http://ipv6.example.com/bosixnet/counter
http://ipv6.example.com/bosixnet/hosts
http://ipv6.example.com/bosixnet/
Example of configuring nginx:
Edit file /etc/nginx/sites-available/default and paste something like this:
location /bosixnet/ {
fastcgi_pass localhost:33169;
include /etc/nginx/fastcgi_params;
}
Example of configuring lighttpd:
Edit file /etc/lighttpd/lighttpd.conf and paste something like this:
fastcgi.server = ( "/bosixnet/" =>
(( "host" => "127.0.0.1",
"port" => 33169,
"check-local" => "disable",
"docroot" => "/var/tmp/bosixnet",
))
)
bosixnet-1.7/Version.h.in000066400000000000000000000000531260260264400154170ustar00rootroot00000000000000#pragma once
#define VERSION "@VERSION@"
bosixnet-1.7/changelog000066400000000000000000000050301260260264400150660ustar00rootroot00000000000000--- 1.7 2015-09-30 ---
*** common ***
* Relicense from GPLv2 or later to Expat.
*** bosixnet-daemon ***
* Use `ip` tool instead of `ifconfig` for getting local IPv6 address.
* Added ability to select specific network device for getting local IPv6
address. By default script searches IPv6 addresses for all network devices
of the system and chooses the last of them.
* Protect file with list of hosts from simultaneous editing.
* Additional check if current IPv6 address is valid.
--- 1.6 2014-02-11 ---
*** bosixnet-daemon ***
* Improved simple check for validity of IPv6 addresses received from server:
- strings should be longer than 6 characters
- strings should have at least three ":" characters
- fifth character from strings should be equal to ":"
(Affects only script update_hosts.)
* Added support of multiple servers:
- IPv6 address is sent to all available servers
- data about hosts is got from the first server which replies to request
See file bosixnet-daemon.conf for examples of configuring.
*** bosixnet-webui ***
* Removed support of POST requests.
* Added simple check for valid IPv6 address received in GET request:
- string should be longer than 7 characters
- string should be shorter than 40 characters
- string should have at least three ":" characters
- fifth character from string should be equal to ":"
- string should contain only allowed characters (:0123456789abcdefABCDEF)
The same check is used during loading the list of hosts from file.
--- 1.5 2014-02-05 ---
* Changed default user in webui_launcher from "user" to "bosixnet".
* Added man pages, updated README and fixed few typos in help.
* Renamed BASIC_URL variable to BASIC_STR.
--- 1.4 2014-02-04 ---
* Improved update_hosts: only strings with IPv6 addresses is copied into
/etc/hosts, all rest data is ignored now.
* Small code refactoring in scripts: bosixnet_daemon, update_address,
update_hosts, webui_launcher.
--- 1.3 2014-02-04 ---
* Small fix in bosixnet_daemon: send some useless warnings to /dev/null.
* Tiny fix in LOG_DIR variable.
--- 1.2 2014-02-04 ---
* Rewritten init scripts.
* Added script daemon_launcher.
* Updated script webui_launcher.
--- 1.1 2014-02-04 ---
* Update init scripts.
--- 1.0 2014-02-03 ---
* Changed version numbering scheme.
* Project was rewritten from qmake to cmake.
* Program bosixnet-webui was rewritten from QtCore 4.x to pure STL.
* Added support of config files into scripts: bosixnet_daemon, update_address,
update_hosts and webui_launcher.
* Updated README.
--- 0.0.1 2013-10-17 ---
* Initial release.
bosixnet-1.7/src/000077500000000000000000000000001260260264400140055ustar00rootroot00000000000000bosixnet-1.7/src/bosixnet-daemon/000077500000000000000000000000001260260264400171015ustar00rootroot00000000000000bosixnet-1.7/src/bosixnet-daemon/CMakeLists.txt000066400000000000000000000020621260260264400216410ustar00rootroot00000000000000project (bosixnet_daemon)
cmake_minimum_required (VERSION 2.8)
execute_process (COMMAND gzip -9
INPUT_FILE ${PROJECT_NAME}.1
OUTPUT_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.1.gz
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/)
install (FILES ${PROJECT_NAME}
DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install (FILES bosixnet-daemon
DESTINATION "/etc/init.d/"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install (FILES daemon_launcher update_address update_hosts
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/bosixnet/"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install (FILES bosixnet-daemon.conf
DESTINATION "/etc/bosixnet/")
install (FILES ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.1.gz
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1")
bosixnet-1.7/src/bosixnet-daemon/bosixnet-daemon000077500000000000000000000041171260260264400221260ustar00rootroot00000000000000#!/bin/bash
### BEGIN INIT INFO
# Provides: bosixnet-daemon
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts bosixnet_daemon
# Description: starts script which check ipv6 address each N minutes
### END INIT INFO
# Author: Boris Pek
# Last updated: 2014-02-04
NAME=bosixnet_daemon
DESC="BOSixNet daemon"
DAEMON=/usr/lib/bosixnet/daemon_launcher
DAEMON_OPTS=
SCRIPT=bosixnet-daemon
PIDFILE=/var/run/${NAME}.pid
[ -x ${DAEMON} ] || exit 0
. /lib/lsb/init-functions
set -e
check_start() {
set +e
DAEMON_PID="$(pidof -x ${NAME})"
if [ ! -z "${DAEMON_PID}" ]; then
log_end_msg $?
exit 0
fi
set -e
}
check_stop() {
set +e
DAEMON_PID="$(pidof -x ${NAME})"
if [ ! -z "${DAEMON_PID}" ]; then
killall -9 "${NAME}" >/dev/null 2>/dev/null
sleep 1
fi
set -e
}
start() {
check_start
start-stop-daemon --start --quiet --pidfile "${PIDFILE}" \
--exec "${DAEMON}" --oknodo -- ${DAEMON_OPTS}
}
stop() {
start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" \
--exec "${DAEMON}" --oknodo --retry 5
sleep 1
check_stop
}
case "$1" in
start)
log_daemon_msg "Starting ${DESC}" "${NAME}"
start
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping ${DESC}" "${NAME}"
stop
log_end_msg $?
;;
restart|force-reload)
log_daemon_msg "Restarting ${DESC}" "${NAME}"
stop
sleep 1
start
log_end_msg $?
;;
status)
status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}" && exit 0 || exit $?
;;
install)
cp -f ${0} /etc/init.d/${SCRIPT}
insserv bosixnet-webui
;;
remove)
rm -f /etc/rc*.d/*${SCRIPT}*
rm -f /etc/init.d/${SCRIPT}
;;
*)
echo "Usage: /etc/init.d/${SCRIPT} {start|stop|restart|force-reload|status|install|remove}" >&2
exit 1
;;
esac
exit 0
bosixnet-1.7/src/bosixnet-daemon/bosixnet-daemon.conf000066400000000000000000000013231260260264400230430ustar00rootroot00000000000000# Period of updating IPv6 address and /etc/hosts [seconds]:
#UPD_PERIOD=300
# Directory with auxiliary scripts:
#DIR_UTIL="/usr/lib/bosixnet"
# Directory where generated host file is stored:
#LOG_DIR=/var/tmp/bosixnet
# Network device:
#NETWORK_DEVICE=teredo
# Host name
#HOST_NAME=my-laptop
# Web-site URL
#URL="http://ipv6.example.com/bosixnet"
#
# You may use multiple servers. For setting them use something like this:
#URL="http://my-personal-server/bosixnet
# http://my-friend's-server/bosixnet
# http://common-backup-server/bosixnet"
#
# In the case of using multiple servers:
# - IPv6 address is sent to all available servers
# - data about hosts is got from the first server which replies to request
bosixnet-1.7/src/bosixnet-daemon/bosixnet_daemon000077500000000000000000000021031260260264400222010ustar00rootroot00000000000000#!/bin/sh
# Config file
CONF_FILE="/etc/bosixnet/bosixnet-daemon.conf"
# Period of updating IPv6 address and /etc/hosts [seconds]:
UPD_PERIOD=300
# Directory with auxiliary scripts:
DIR_UTIL="/usr/lib/bosixnet"
# Read settings from config file if it exists
[ -e "${CONF_FILE}" ] && . "${CONF_FILE}"
# Check command line options
if [ "${1}" = "-h" -o "${1}" = "--help" ]; then
echo "Usage: bosixnet_daemon [options]
This shell script periodically sends information about current IPv6 address to
remote server and updates local /etc/hosts based on data received from that
remote server. It is expected that bosixnet-webui is launched on remote server.
Generic options:
-h, --help show help
-v, --version show version
Settings are in config file: ${CONF_FILE}"
exit 0
elif [ "${1}" = "-v" -o "${1}" = "--version" ]; then
echo "Last updated: 2014-02-05"
exit 0
fi
# Infinite cycle for periodical updates
while [ 1 ]; do
"${DIR_UTIL}/update_address" >/dev/null 2>/dev/null
"${DIR_UTIL}/update_hosts" >/dev/null 2>/dev/null
sleep ${UPD_PERIOD}
done
bosixnet-1.7/src/bosixnet-daemon/bosixnet_daemon.1000066400000000000000000000022531260260264400223430ustar00rootroot00000000000000.TH "bosixnet_daemon" 1 "05 Feb 2014"
.SH "NAME"
bosixnet_daemon \- shell script which periodically sends information about current IPv6 address to remote server and updates local /etc/hosts based on data received from that remote server. It is expected that bosixnet-webui is launched on that remote server.
.SH "SYNOPSIS"
.PP
.B bosixnet_daemon
[options]
.SH "DESCRIPTION"
.PP
\fBBOSixNet\fP \-\- Build Own IPv6 Network.
.TP
Project should be useful when you have to administer many computers distributed through different networks and connected via NAT. In most of cases you may just install miredo, gogoc or any other tunnel broker's software and these computers will be available via IPv6 addresses. BOSixNet includes the collection of tools for automatic updating the list of such hosts.
.SH "OPTIONS"
.RB "Generic options:"
.TP
.BR "\-h, \-\-help"
Show help and exit.
.TP
.BR "\-v, \-\-version"
Show version and exit.
.SH "FILES"
.TP
.B "/etc/bosixnet/"
Directory with configuration files.
.SH "DOCUMENTATION"
.TP
Basic information: \fBhttps://github.com/tehnick/bosixnet/blob/master/README\fR
.SH "BUG REPORTS"
Please report bugs here:
\fBhttps://github.com/tehnick/bosixnet/issues\fR
bosixnet-1.7/src/bosixnet-daemon/daemon_launcher000077500000000000000000000000641260260264400221530ustar00rootroot00000000000000#!/bin/bash
/usr/bin/bosixnet_daemon >/dev/null &
bosixnet-1.7/src/bosixnet-daemon/update_address000077500000000000000000000020661260260264400220220ustar00rootroot00000000000000#!/bin/sh
# Config file
CONF_FILE="/etc/bosixnet/bosixnet-daemon.conf"
# Default host name
HOST_NAME="$(uname -n)"
# Default web-site URL
URL="http://ipv6.example.com/bosixnet"
# Read settings from config file if it exists
[ -e "${CONF_FILE}" ] && . "${CONF_FILE}"
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
if [ ! -z "${NETWORK_DEVICE}" ]; then
IPv6_INFO="$(ip -6 addr show "${NETWORK_DEVICE}" | grep -i global)"
else
IPv6_INFO="$(ip -6 addr | grep -i global)"
fi
if [ ! -z "${IPv6_INFO}" ]; then
# Get current IPv6 address using simple regexp
IPv6_CUR=$(echo "${IPv6_INFO}" | sed -ne "s|^.*inet6\ \(.*\)/[0-9]*\ .*$|\1|p" | tail -n1)
# Check if this IPv6 address is valid
IPv6_CUR="$(echo "${IPv6_CUR}" | grep '^....:.*:.*:.*')"
fi
if [ ! -z "${IPv6_CUR}" ]; then
for DEST in ${URL} ; do
LINK="${DEST}/${HOST_NAME}"
IPv6_OLD="$(curl ${LINK} 2>/dev/null)"
if [ "${IPv6_OLD}" != "${IPv6_CUR}" ]; then
curl "${LINK}?update=${IPv6_CUR}" 2>/dev/null >/dev/null
fi
done
fi
bosixnet-1.7/src/bosixnet-daemon/update_hosts000077500000000000000000000030371260260264400215340ustar00rootroot00000000000000#!/bin/sh
# Config file
CONF_FILE="/etc/bosixnet/bosixnet-daemon.conf"
# Directory where generated host file is stored
LOG_DIR="/var/tmp/bosixnet"
# Default web-site URL
URL="http://ipv6.example.com/bosixnet"
# Read settings from config file if it exists
[ -e "${CONF_FILE}" ] && . "${CONF_FILE}"
# Protect file with list of hosts from simultaneous editing
SCRIPT_NAME="$(basename ${0})"
if [ ! -z "$(pidof -o %PPID -x ${SCRIPT_NAME})" ]; then
echo "Another instance of ${SCRIPT_NAME} script is already running."
echo "Please wait until it is finished and try again."
exit 1
fi
HOSTS="/etc/hosts"
FILE="${LOG_DIR}/hosts"
[ -e "${FILE}" ] && CUR_INFO="$(cat ${FILE} | grep '^....:.*:.*:.*')"
if [ -z "${CUR_INFO}" ]; then
echo "File ${FILE} does not exist or does not contain correct data."
for DEST in ${URL} ; do
LINK="${DEST}/hosts"
echo "Trying to get data from ${LINK}..."
CUR_INFO="$(curl ${LINK} 2>/dev/null | sed 's/
//' | grep '^....:.*:.*:.*')"
if [ -z "${CUR_INFO}" ]; then
echo "Attempt to get data from ${LINK} failed."
else
echo "Data from ${LINK} have been received successfully."
break
fi
done
fi
if [ -z "${CUR_INFO}" ]; then
echo "Data failed to be received from specified resources."
exit 1
fi
cp -f "${HOSTS}" "${HOSTS}.backup"
cat "${HOSTS}.backup" | grep -v '^....:.*:.*:.*' | tee "${HOSTS}" > /dev/null
echo "${CUR_INFO}" | tee -a "${HOSTS}" > /dev/null
echo "There are such data in ${HOSTS} now:"
cat "${HOSTS}"
bosixnet-1.7/src/bosixnet-webui/000077500000000000000000000000001260260264400167515ustar00rootroot00000000000000bosixnet-1.7/src/bosixnet-webui/CMakeLists.txt000066400000000000000000000020751260260264400215150ustar00rootroot00000000000000project (bosixnet_webui)
cmake_minimum_required (VERSION 2.8)
include_directories(${CMAKE_BINARY_DIR})
add_executable (${PROJECT_NAME} bosixnet-webui.cpp)
target_link_libraries (${PROJECT_NAME} fcgi)
execute_process (COMMAND gzip -9
INPUT_FILE ${PROJECT_NAME}.1
OUTPUT_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.1.gz
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/)
install (TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/")
install (FILES bosixnet-webui
DESTINATION "/etc/init.d/"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install (FILES webui_launcher
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/bosixnet/"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install (FILES bosixnet-webui.conf
DESTINATION "/etc/bosixnet/")
install (FILES ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.1.gz
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1")
bosixnet-1.7/src/bosixnet-webui/bosixnet-webui000077500000000000000000000041051260260264400216430ustar00rootroot00000000000000#!/bin/bash
### BEGIN INIT INFO
# Provides: bosixnet-webui
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts bosixnet_webui
# Description: starts FastCGI program for generating /etc/hosts
### END INIT INFO
# Author: Boris Pek
# Last updated: 2014-02-04
NAME=bosixnet_webui
DESC="BOSixNet server"
DAEMON=/usr/lib/bosixnet/webui_launcher
DAEMON_OPTS=
SCRIPT=bosixnet-webui
PIDFILE=/var/run/${NAME}.pid
[ -x ${DAEMON} ] || exit 0
. /lib/lsb/init-functions
set -e
check_start() {
set +e
DAEMON_PID="$(pidof -x ${NAME})"
if [ ! -z "${DAEMON_PID}" ]; then
log_end_msg $?
exit 0
fi
set -e
}
check_stop() {
set +e
DAEMON_PID="$(pidof -x ${NAME})"
if [ ! -z "${DAEMON_PID}" ]; then
killall -9 "${NAME}" >/dev/null 2>/dev/null
sleep 1
fi
set -e
}
start() {
check_start
start-stop-daemon --start --quiet --pidfile "${PIDFILE}" \
--exec "${DAEMON}" --oknodo -- ${DAEMON_OPTS}
}
stop() {
start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" \
--exec "${DAEMON}" --oknodo --retry 5
sleep 1
check_stop
}
case "$1" in
start)
log_daemon_msg "Starting ${DESC}" "${NAME}"
start
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping ${DESC}" "${NAME}"
stop
log_end_msg $?
;;
restart|force-reload)
log_daemon_msg "Restarting ${DESC}" "${NAME}"
stop
sleep 1
start
log_end_msg $?
;;
status)
status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}" && exit 0 || exit $?
;;
install)
cp -f ${0} /etc/init.d/${SCRIPT}
insserv bosixnet-webui
;;
remove)
rm -f /etc/rc*.d/*${SCRIPT}*
rm -f /etc/init.d/${SCRIPT}
;;
*)
echo "Usage: /etc/init.d/${SCRIPT} {start|stop|restart|force-reload|status|install|remove}" >&2
exit 1
;;
esac
exit 0
bosixnet-1.7/src/bosixnet-webui/bosixnet-webui.conf000066400000000000000000000007321260260264400225660ustar00rootroot00000000000000# Basic part of full URL on server. For example:
# if full URL looks like http://ipv6.example.com/bosixnet/
# then BASIC_STR should be "/bosixnet/" or "/".
#BASIC_STR=/bosixnet/
BASIC_STR=/
# Directory where generated host file will be stored:
#LOG_DIR=/var/tmp/bosixnet
# Launch bosixnet-webui from specific user:
#USERID=bosixnet
#GROUPID=bosixnet
# TCP port to which to bind on localhost
#FCGIPORT=33169
# Number of bosixnet-webui children to spawn
#FCGI_CHILDREN=1
bosixnet-1.7/src/bosixnet-webui/bosixnet-webui.cpp000066400000000000000000000271241260260264400224270ustar00rootroot00000000000000/*****************************************************************************
* *
* Copyright (c) 2013-2015 Boris Pek *
* *
* Permission is hereby granted, free of charge, to any person obtaining *
* a copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to *
* the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY *
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, *
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE *
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
*****************************************************************************/
#include
#include
#include
#include
#include