Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
# detect, of we have already added an alias,
# if not, do it:
. /lib/functions.sh
config_load network
alread_added()
{
local config="$1"
local ip="$2"
test "$( uci get network.$config.ipaddr )" = "$ip" && X=true
}
X=
config_foreach alread_added alias 10.10.43.33
[ $X ] && add_alias
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment