aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/bin/ipcalc.sh
Commit message (Collapse)AuthorAgeFilesLines
* base-files: ipcalc.sh: fix awk regex syntaxLeon M. George2023-02-071-1/+1
| | | | | | It worked fine before but gawk warns about it. Signed-off-by: Leon M. George <leon@georgemail.eu>
* base-files: ipcalc.sh: trim for statementLeon M. George2023-02-071-2/+8
| | | | | | For gawk compatibility. Signed-off-by: Leon M. George <leon@georgemail.eu>
* base-files: ipcalc.sh: use shebang to invoke awkLeon M. George2023-02-071-3/+1
| | | | | | | | | | | There's hardly an shell logic in ipcalc.sh and a $* that would garble parameter positions. Move the awk invokation to the shebang. A rename from "ipcalc.sh" to "ipcalc" is desirable but could prove tricky with packages in other repositories depending on the filename. Signed-off-by: Leon M. George <leon@georgemail.eu>
* base-files: ipcalc.sh: fail when network is too smallLeon M. George2023-02-071-1/+7
| | | | | | | | It's possible to move range boundaries in a way that the start address lies behind the end address. Detect this condition and exit with an error message. Signed-off-by: Leon M. George <leon@georgemail.eu>
* base-files: ipcalc.sh: don't include own address in rangeLeon M. George2023-02-071-0/+7
| | | | | | Make sure our own address doesn't lie in the calculated range. Signed-off-by: Leon M. George <leon@georgemail.eu>
* base-files: ipcalc.sh: check for params before calculating start/endLeon M. George2023-02-071-12/+13
| | | | | | | With this patch, ipcalc only calculates range boundaries if the corresponding parameters are supplied. Signed-off-by: Leon M. George <leon@georgemail.eu>
* base-files: ipcalc.sh: support bit length as netmask parameterJo-Philipp Wich2013-12-161-1/+5
| | | | SVN-Revision: 39100
* base-files: fix whitespacesLuka Perkov2013-12-091-1/+1
| | | | | | Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 39006
* base-files: ipcalc.sh: fix broken calculations on 64bit systemsJo-Philipp Wich2012-12-231-5/+10
| | | | | | | | Calculate complements by using awk's xor() function with a mask of 0xffffffff instead of relying on the compl() function which appears to produce broken results on certain 64bit architectures. SVN-Revision: 34875
* ipcalc.sh CIDR notation Hi,Jo-Philipp Wich2011-05-181-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the attached patch makes ipcalc.sh accept IP/Netmask combinations in CIDR notation. Before you could only do: # sh ipcalc.sh 192.168.0.0 255.255.255.0 1 10 IP=192.168.0.0 NETMASK=255.255.255.0 BROADCAST=192.168.0.255 NETWORK=192.168.0.0 PREFIX=24 START=192.168.0.1 END=192.168.0.11 with this patch you can also execute it with: sh ipcalc.sh 192.168.0.0/24 1 10 IP=192.168.0.0 NETMASK=255.255.255.0 BROADCAST=192.168.0.255 NETWORK=192.168.0.0 PREFIX=24 START=192.168.0.1 END=192.168.0.11 The patch is based on #1260 [1], i just changed one line to calculate the START end END ips right. I wonder why that never got included. If there is no reason not to do i would like to ask you to commit that patch, because its a functionality i (and probably others) miss quite often. Btw, i also fixed 4 useless tabs, that might look a bit strange in the patch. Regards, Manuel SVN-Revision: 26930
* base-files: remove a stale reference to /usr/lib/common.awk (thx, swalker)Felix Fietkau2011-02-131-1/+1
| | | | SVN-Revision: 25528
* base-files: /usr/lib/common.awk is only used by /bin/ipcalc.sh, move the ↵Felix Fietkau2011-02-131-0/+21
| | | | | | code there SVN-Revision: 25495
* base-files: ipcalc.sh: fix off-by-one in range-calculationJo-Philipp Wich2009-06-291-1/+1
| | | | SVN-Revision: 16619
* upgrade dnsmasq to latest version, rewrite dnsmasq init script for uci, ↵Felix Fietkau2007-03-171-0/+32
rename /bin/ipcalc to /bin/ipcalc.sh (fixes #1452) SVN-Revision: 6595