-
Notifications
You must be signed in to change notification settings - Fork 0
Disable routing #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable routing #12
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| #! /usr/bin/bash | ||
|
|
||
|
|
||
| # Check for jq | ||
| if ! command -v jq &> /dev/null | ||
| then | ||
|
|
@@ -32,18 +31,29 @@ echo "The nickname is: $1" | |
|
|
||
| NICKNAME=$1 | ||
|
|
||
| #nordvpn set meshnet off | ||
| #nordvpn set routing disable | ||
|
|
||
| # Enable Meshnet and set the device's nickname | ||
| nordvpn set meshnet on | ||
| nordvpn meshnet set nickname $NICKNAME | ||
|
|
||
| # Enable notifications for connection status changes. | ||
| nordvpn set notify on | ||
|
|
||
| # Disable Perfect Forward Secrecy (PFS) to allow for better compatibility with certain devices and configurations. | ||
| nordvpn set pq off | ||
|
Comment on lines
+44
to
45
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: The command Citations:
Correct the comment to accurately describe the The code comment refers to "Perfect Forward Secrecy (PFS)" but 🤖 Prompt for AI Agents |
||
|
|
||
| # Disable LAN discovery to prevent the device from being visible on the local network, enhancing security when acting as an exit node. | ||
| nordvpn set lan-discovery off | ||
|
|
||
| # Set the VPN protocol to NordLynx for improved performance and security. | ||
| nordvpn set technology nordlynx | ||
|
|
||
| # Set auto-connect for this device | ||
| nordvpn set autoconnect on | ||
| # Set auto-connect for this device to a specific country (e.g., Norway). Adjust as needed. | ||
| nordvpn set autoconnect on Norway | ||
|
|
||
| # | ||
| PEERS_FILE="$(dirname "$0")/peers.json" | ||
|
|
||
| # Check if the peers file exists | ||
|
|
@@ -67,8 +77,25 @@ if ! mapfile -t ALL_PEERS < <(jq -r '.all_peers[]' "$PEERS_FILE"); then | |
| exit 1 | ||
| fi | ||
|
|
||
| if ! mapfile -t FILESHARE_PEERS < <(jq -r '.allowed_for_fileshare[]' "$PEERS_FILE"); then | ||
| echo "Error: Failed to parse 'allowed_for_fileshare' from '$PEERS_FILE'." >&2 | ||
| echo "Please ensure it's a valid JSON file with an 'allowed_for_fileshare' key containing an array of strings." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Reading all peers from '$PEERS_FILE'..." | ||
| if ! mapfile -t ALL_PEERS < <(jq -r '.all_peers[]' "$PEERS_FILE"); then | ||
| echo "Error: Failed to parse 'all_peers' from '$PEERS_FILE'." >&2 | ||
| echo "Please ensure it's a valid JSON file with an 'all_peers' key containing an array of strings." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Configuring fileshare and auto-accept for specific peers..." | ||
| for PEER in "${FILESHARE_PEERS[@]}"; do | ||
| # Don't try to change permissions for the device this script is running on. | ||
| if [[ "$PEER" == "$NICKNAME" ]]; then | ||
| continue | ||
| fi | ||
| nordvpn meshnet peer fileshare allow "$PEER" && echo " - Allowed fileshare for '$PEER'." | ||
| nordvpn meshnet peer auto-accept enable "$PEER" && echo " - Enabled auto-accept for '$PEER'." | ||
| done | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote the variable to prevent word splitting.
The
$NICKNAMEvariable should be quoted to prevent potential issues if the nickname contains spaces or special characters.🛡️ Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 Shellcheck (0.11.0)
[info] 39-39: Double quote to prevent globbing and word splitting.
(SC2086)
🤖 Prompt for AI Agents