Files
dokku/plugins/network/internal-functions
Jose Diaz-Gonzalez ec9b8be5f8 feat: implement first-pass at networking plugin
Implements help, `rebuild`, and `rebuildall` command.

Refs #2403
2017-10-02 15:05:13 -07:00

28 lines
770 B
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
network_help_content_func() {
declare desc="return network plugin help content"
cat<<help_content
network:rebuild <app>, Rebuilds network settings for an app
network:rebuildall, Rebuild network settings for all apps
help_content
}
network_help_cmd() {
if [[ $1 = "network:help" ]] ; then
echo -e 'Usage: dokku network[:COMMAND]'
echo ''
echo 'Rebuilds network settings for an app.'
echo ''
echo 'Additional commands:'
network_help_content_func | sort | column -c2 -t -s,
elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then
network_help_content_func
else
cat<<help_desc
network, Manage network configuration for applications
help_desc
fi
}