Skip to content

Commit

Permalink
Remove lite and merge current
Browse files Browse the repository at this point in the history
  • Loading branch information
spmzt committed Jul 8, 2024
2 parents 321bc99 + 3f1e8a1 commit 27aa5c6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ After the prompt return, you should be able to access your device through the co
- **NOTE:** You can also run the script in **non-interactive** mode, doing:

```sh
wanpadctl <DOMAIN HERE> <TOKEN HERE>
wanpadctl init <DOMAIN HERE> <TOKEN HERE>
```

## Contributions
Expand Down
2 changes: 1 addition & 1 deletion usr/local/etc/wanpad/wanpad.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ SSL=true

# OpenVPN Client
# The ".ovpn" file must be located under /usr/local/etc/wanpad/ directory.
OOB_CONFIG_FILE=client.ovpn
OOB_CONFIG_FILE=client.ovpn
2 changes: 1 addition & 1 deletion usr/local/share/wanpad/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ case "$NA" in
ztp_dialogue
;;
2)
DOMAIN=$1
CONTROLLER_DOMAIN=$1
TOKEN=$2
;;
*)
Expand Down
7 changes: 6 additions & 1 deletion usr/local/share/wanpad/lib/install-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ enable_wanpad_systemd_services()

start_wanpad_services()
{
service wanpad-* start || true
if [ "$OSKERNEL" = "Linux" ]
then
systemctl start wanpad-*.service --all || true
else
service wanpad-* start || true
fi
}

enable_ipv4_forward()
Expand Down
4 changes: 2 additions & 2 deletions usr/local/share/wanpad/lib/ztp-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ run_ztp_py()
set -a
. /usr/local/etc/wanpad/wanpad.conf
set +a
export CONTROLLER_TOKEN_VALIDATION_URL="$(get_controller_url /wanpad/api/v1/auth/validate_token/)"
export CONTROLLER_TOKEN_URL="$(get_controller_url /wanpad/api/v1/devices/plug_play/)"
python3 /usr/local/share/wanpad/ztp/pnp-client.py
}
}
2 changes: 1 addition & 1 deletion usr/local/share/wanpad/ztp/pnp-client.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def client_program():
"hostname": socket.gethostname(),
"token": os.environ['TOKEN'],
"dsf": dsf}
url = os.environ['CONTROLLER_TOKEN_VALIDATION_URL']
url = os.environ['CONTROLLER_TOKEN_URL']
request_to_url = requests.post(url, verify=False, data=data, timeout=6)
if request_to_url.status_code == 400:
print(request_to_url.text)
Expand Down

0 comments on commit 27aa5c6

Please sign in to comment.