-
Notifications
You must be signed in to change notification settings - Fork 52
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
ifup-routes: print warning when ADDRESS0 entry is missing #475
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 |
---|---|---|
|
@@ -14,6 +14,13 @@ | |
handle_file () { | ||
. $1 | ||
routenum=0 | ||
|
||
# print a warning if ADDRESS is not starting at ADDRESS0 | ||
if [ "x$(eval echo '$'ADDRESS$routenum)x" == "xx" ]; then | ||
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. Looks, fine but two small nitpicks for the future. Since the routenum is always 0, the whole eval shenanigan is unnecessary. Simple [ -z "$ADDRESS0" ] would be much nicer. |
||
net_log $"Route entries are not sequentially ordered. Skipping $1 file" warning | ||
exit 1 | ||
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. THis can potentially change the behaviour. |
||
fi | ||
|
||
while [ "x$(eval echo '$'ADDRESS$routenum)x" != "xx" ]; do | ||
eval $(ipcalc -p $(eval echo '$'ADDRESS$routenum) $(eval echo '$'NETMASK$routenum)) | ||
line="$(eval echo '$'ADDRESS$routenum)/$PREFIX" | ||
|
Check warning
Code scanning / shellcheck
Avoid x-prefix in comparisons as it no longer serves a purpose. Warning