Skip to content

Instantly share code, notes, and snippets.

@bittorf
Created April 28, 2015 14:09
Show Gist options
  • Select an option

  • Save bittorf/7db7d53f56b578120d87 to your computer and use it in GitHub Desktop.

Select an option

Save bittorf/7db7d53f56b578120d87 to your computer and use it in GitHub Desktop.
#!/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