Skip to content

Commit 88343b9

Browse files
committed
Arch ipcalc doesn't include network anymore: $ ipcalc 10.0.0.1 255.255.255.255 Address: 10.0.0.1 00001010.00000000.00000000.00000001 Netmask: 255.255.255.255 = 32 11111111.11111111.11111111.11111111 Wildcard: 0.0.0.0 00000000.00000000.00000000.00000000 => Hostroute: 10.0.0.1 00001010.00000000.00000000.00000001 Hosts/Net: 1 Class A, Private Internet The redhat package from Aur does.
1 parent 043fdd2 commit 88343b9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

build/root/install.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,17 @@ mv /tmp/scripts-master/shell/arch/docker/*.sh /usr/local/bin/
3838
####
3939

4040
# define pacman packages
41-
pacman_packages="base-devel cargo openssl-1.1 kmod openvpn privoxy bind-tools ipcalc wireguard-tools openresolv libnatpmp ldns"
41+
pacman_packages="base-devel cargo openssl-1.1 kmod openvpn privoxy bind-tools wireguard-tools openresolv libnatpmp ldns"
4242

4343
# install pre-reqs
4444
pacman -S --needed $pacman_packages --noconfirm
4545

46+
# define aur packages
47+
aur_packages="ipcalc-redhat"
48+
49+
# call aur install script (arch user repo)
50+
source aur.sh
51+
4652
# github release - microsocks
4753
####
4854

run/local/tools.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function get_docker_networking() {
7373
docker_mask=$(ifconfig "${docker_interface}" | grep -P -o -m 1 '(?<=netmask\s)[^\s]+')
7474

7575
# convert netmask into cidr format, strip leading spaces
76-
docker_network_cidr=$(ipcalc "${docker_ip}" "${docker_mask}" | grep -P -o -m 1 "(?<=Network:)\s+[^\s]+" | sed -e 's/^[[:space:]]*//')
76+
docker_network_cidr=$(ipcalc -n -p "${docker_ip}" "${docker_mask}" | awk -F'=' '/^NETWORK/ {network=$2} /^PREFIX/ {prefix=$2} END {print network "/" prefix}')
7777

7878
# append docker interface, gateway adapter, gateway ip, ip, mask and cidr to string
7979
docker_networking+="${docker_interface},${default_gateway_adapter},${default_gateway_ip},${docker_ip},${docker_mask},${docker_network_cidr} "

0 commit comments

Comments
 (0)