Skip to content

Commit

Permalink
Make down commands only run if interface exists
Browse files Browse the repository at this point in the history
  • Loading branch information
whiskerz007 authored and FossoresLP committed Mar 2, 2021
1 parent f5e9ded commit 7ab9de1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions opt/wireguard/interface.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ fi
if ! ip link show dev $INTERFACE &> /dev/null; then
# Create link
sudo ip link add dev $INTERFACE type wireguard
else
# Run all configured 'down' commands
eval "$(node_value down-command)" > /dev/null || exit 1
fi

# Run all configured 'down' commands
eval "$(node_value down-command)" > /dev/null || exit 1

# If interface is deleted
if [ "$ACTION" = DELETE ]; then
# Delete link
Expand Down

0 comments on commit 7ab9de1

Please sign in to comment.