Skip to content

Commit

Permalink
Replace test and [ with bash's [[
Browse files Browse the repository at this point in the history
No change in behavior
  • Loading branch information
DemiMarie committed Oct 31, 2024
1 parent a324b82 commit 83c688e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions network/vif-qubes-nat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function netns
run ip addr flush dev "$netns_appvm_if"
run ip netns delete "$netns" || :

if test "$command" = online; then
if [[ "$command" = online ]]; then
echo 1 > "/proc/sys/net/ipv6/conf/$netns_appvm_if/disable_ipv6"
run ip netns add "$netns"
run ip link set "$netns_appvm_if" netns "$netns"
Expand All @@ -63,7 +63,7 @@ if test "$command" = online; then

netns sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'

if test -n "$undetectable_netvm_ips"; then
if [[ -n "$undetectable_netvm_ips" ]]; then
# prevent an AppVM connecting to its own ProxyVM IP because that makes the internal IPs detectable even with no firewall rules
more_antispoof=" ip daddr != { $netvm_ip, $netvm_gw_ip, $netvm_dns1_ip, $netvm_dns2_ip }"
else
Expand Down
6 changes: 3 additions & 3 deletions network/vif-route-qubes
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ $nftables_cmd element $ipt qubes downstream { $addr }"
# "allowed" map
fi

if [ "$command" = "online" ]; then
if [[ "$command" = "online" ]]; then
ip link set dev "${vif}" group 2 up
fi

Expand All @@ -245,7 +245,7 @@ if [ "${ip}" ]; then
network_hooks "${command}" "${vif}" "${addr}"
done
${cmdprefix} ip addr "${ipcmd}" "${back_ip}/32" dev "${vif}"
if [ "${back_ip6}" ] && [[ "${back_ip6}" != "fe80:"* ]] && [[ "$ipv6_disabled" = '0' ]]; then
if [[ -n "${back_ip6}" ]] && [[ "${back_ip6}" != "fe80:"* ]] && [[ "$ipv6_disabled" = '0' ]]; then
${cmdprefix} ip addr "${ipcmd}" "${back_ip6}/128" dev "${vif}"
echo 1 >"/proc/sys/net/ipv6/conf/${vif}/proxy_ndp"
fi
Expand All @@ -254,6 +254,6 @@ else
fi

log debug "Successful vif-route-qubes $command for $vif."
if [ "$command" = "online" ]; then
if [[ "$command" = "online" ]]; then
success
fi

0 comments on commit 83c688e

Please sign in to comment.