Skip to content

Commit

Permalink
Update sed command for getting vlan_id from cmdline:
Browse files Browse the repository at this point in the history
This fixes an issue where "vlan_id" is a substring.
For example: "thisisavlan_id=123". This example will
be treated as if the vlan_id was not set at all.

Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
  • Loading branch information
jacobweinstock committed Aug 25, 2023
1 parent 1c438a9 commit cd752aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/dhcp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ run_dhcp_client() {
one_shot="$1"
al="eth*"

vlan_id=$(sed -n 's/.*vlan_id=\([0-9]*\).*/\1/p' /proc/cmdline)
vlan_id=$(sed -n 's/.* vlan_id=\([0-9]*\).*/\1/p' /proc/cmdline)
if [ -n "$vlan_id" ]; then
al="eth*.*"
fi
Expand Down

0 comments on commit cd752aa

Please sign in to comment.