Skip to content

Commit

Permalink
treehouses services ntopng added (fixes #618) (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
LordJashin32 authored Feb 6, 2020
1 parent a0e9dd5 commit 1543f45
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
26 changes: 23 additions & 3 deletions modules/services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ function services {
echo "portainer built and started"
check_tor "9000"
;;
ntopng)
docker volume create ntopng_data
docker run --name ntopng -d -p 8090:8090 -v /var/run/docker.sock:/var/run/docker.sock -v ntopng_data:/data jonbackhaus/ntopng --http-port=8090
echo "ntopng built and started"
check_tor "8090"
;;
*)
echo "unknown service"
;;
Expand All @@ -146,7 +152,7 @@ function services {

down)
case "$service_name" in
planet|kolibri|pihole|moodle|privatebin|nextcloud|portainer)
planet|kolibri|pihole|moodle|privatebin|nextcloud|portainer|ntopng)
if [ ! -e /srv/${service_name}/${service_name}.yml ]; then
echo "yml file doesn't exit"
else
Expand All @@ -162,7 +168,7 @@ function services {

start)
case "$service_name" in
planet|kolibri|pihole|moodle|privatebin|nextcloud|portainer)
planet|kolibri|pihole|moodle|privatebin|nextcloud|portainer|ntopng)
if docker ps -a | grep -q $service_name; then
docker-compose -f /srv/${service_name}/${service_name}.yml start
echo "${service_name} started"
Expand All @@ -178,7 +184,7 @@ function services {

stop)
case "$service_name" in
planet|kolibri|pihole|moodle|privatebin|nextcloud|portainer)
planet|kolibri|pihole|moodle|privatebin|nextcloud|portainer|ntopng)
if docker ps -a | grep -q $service_name; then
docker-compose -f /srv/${service_name}/${service_name}.yml stop
echo "${service_name} stopped"
Expand Down Expand Up @@ -311,6 +317,16 @@ function services {
echo "easily manage your different Docker environments (Docker hosts or"
echo "Swarm clusters).\""
;;
ntopng)
echo "https://github.com/ntop/ntopng"
echo
echo "\"ntopng is the next generation version of the original ntop,"
echo "a network traffic probe that monitors network usage. ntopng is"
echo "based on libpcap and it has been written in a portable way in order"
echo "to virtually run on every Unix platform, MacOSX and on Windows as well."
echo "Educational users can obtain commercial products at no cost please see here:"
echo "https://www.ntop.org/support/faq/do-you-charge-universities-no-profit-and-research/\""
;;
esac
;;

Expand Down Expand Up @@ -421,6 +437,9 @@ function get_port {
portainer)
echo "9000"
;;
ntopng)
echo "8090"
;;
*)
echo "unknown service"
;;
Expand All @@ -438,6 +457,7 @@ function services_help {
# echo " Moodle"
echo " PrivateBin"
echo " Portainer"
echo " Ntopng"
echo
echo
echo "Top-Level Commands:"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@treehouses/cli",
"version": "1.13.10",
"version": "1.13.11",
"description": "Thin command-line interface for Raspberry Pi low level configuration.",
"main": "cli.sh",
"bin": {
Expand Down
7 changes: 7 additions & 0 deletions templates/services/ntopng/ntopng_autorun
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ntopng_autorun=true

if [ "ntopng_autorun" = true ]; then
docker volume create ntopng_data
docker run --name ntopng -d -p 8090:8090 -v /var/run/docker.sock:/var/run/docker.sock -v ntopng_data:/data jonbackhaus/ntopng --http-port=8090
fi

0 comments on commit 1543f45

Please sign in to comment.