Skip to content

Commit 661855e

Browse files
authored
Fix setup.sh to work when .nat_interface doesn't exist (#78)
## Description This is a follow-up to #76 which introduced a failure: ``` provisioner: ./setup.sh: line 117: NAT_INTERFACE: unbound variable ``` ## Why is this needed Unbreak `setup.sh` when used by Vagrant Fixes #77 ## How Has This Been Tested? I used the following simple test case. It works now that the variable is declared first, but still breaks as reported without the fix. ```bash #!/bin/bash set -eu NAT_INTERFACE="" if [ -r .nat_interface ]; then NAT_INTERFACE=$(cat .nat_interface) fi if [ -n "$NAT_INTERFACE" ] && ip addr show "$NAT_INTERFACE" &>/dev/null; then echo "$NAT_INTERFACE" fi ``` ## How are existing users impacted? What migration steps/scripts do we need? Vagrant users are currently broken as reported in the community Slack. ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
2 parents 3fc23c5 + 4243501 commit 661855e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ setup_networking() (
111111
echo "$ERR tinkerbell network interface configuration failed"
112112
fi
113113

114+
NAT_INTERFACE=""
114115
if [ -r .nat_interface ]; then
115116
NAT_INTERFACE=$(cat .nat_interface)
116117
fi

0 commit comments

Comments
 (0)