Skip to content

Commit 89afe53

Browse files
committed
feat: CLI Commands
1 parent 4e1de4f commit 89afe53

File tree

16 files changed

+66
-1
lines changed

16 files changed

+66
-1
lines changed

Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ vsbindir = $(vprefix)/sbin
99
sbin_SCRIPTS =
1010
sbin_SCRIPTS += scripts/eap_proxy.py
1111
sbin_SCRIPTS += scripts/vyatta-service-eap-proxy-update.sh
12+
sbin_SCRIPTS += scripts/vyatta-service-eap-proxy-restart.sh
1213

1314
bin_sudo_users_SCRIPTS =
1415

@@ -19,4 +20,5 @@ cpiop = find . ! -regex '\(.*~\|.*\.bak\|.*\.swp\|.*\#.*\#\)' -print0 | \
1920

2021
install-exec-hook:
2122
mkdir -p $(DESTDIR)$(cfgdir)
22-
cd templates-cfg; $(cpiop) $(DESTDIR)$(cfgdir)
23+
cd templates/cfg; $(cpiop) $(DESTDIR)$(cfgdir)
24+
cd templates/op; $(cpiop) $(DESTDIR)$(opdir)

debian/changelog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
vyatta-eap-proxy (0.3.1) unstable; urgency=low
2+
3+
* `show eap-proxy status` command
4+
* `show eap-proxy logs` command
5+
* `restart eap-proxy` command
6+
7+
-- Morgan Humes <[email protected]> Wed, 28 Feb 2019 00:13:30 -0600
8+
19
vyatta-eap-proxy (0.3.0) unstable; urgency=low
210

311
* Renamed eap-proxy router-interface to rg-interface
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
# Obtain session
3+
eval $(echo $(/bin/cli-shell-api getSessionEnv $PPID))
4+
cli-shell-api setupSession
5+
6+
BIN_PATH="/opt/vyatta/sbin/eap_proxy.py"
7+
PIDFILE="/var/run/eap_proxy.pid"
8+
CONFIG_OPTIONS=(\
9+
"ping-gateway" \
10+
"ignore-when-wan-up" \
11+
"ignore-start" \
12+
"ignore-logoff" \
13+
"restart-dhcp" \
14+
"set-mac" \
15+
)
16+
DAEMON_OPTIONS=(--daemon --pidfile "$PIDFILE" --syslog)
17+
IF_WAN=$(cli-shell-api returnValue service eap-proxy wan-interface)
18+
IF_RG=$(cli-shell-api returnValue service eap-proxy rg-interface)
19+
OPTIONS=()
20+
for option in "${CONFIG_OPTIONS[@]}"; do
21+
if [[ "$(cli-shell-api returnValue service eap-proxy "$option")" == "enable" ]]; then
22+
OPTIONS+=("--$option")
23+
fi
24+
done
25+
26+
/sbin/start-stop-daemon --stop --retry 30 --pidfile "$PIDFILE" --oknodo --quiet
27+
/sbin/start-stop-daemon --start --pidfile "$PIDFILE" --exec "$BIN_PATH" -- \
28+
"$IF_WAN" "$IF_RG" "${OPTIONS[@]}" "${DAEMON_OPTIONS[@]}"

templates-cfg/service/eap-proxy/ignore-logoff/node.def renamed to templates/cfg/service/eap-proxy/ignore-logoff/node.def

File renamed without changes.
File renamed without changes.

templates-cfg/service/eap-proxy/ignore-when-wan-up/node.def renamed to templates/cfg/service/eap-proxy/ignore-when-wan-up/node.def

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)