[BUG] Custombuild 2.0: fails writing configs with multiple server IP-addresses

tim427

Verified User
Joined
Oct 3, 2018
Messages
13
Bash:
root@server:/usr/local/directadmin/custombuild# IP="`grep -r -l -m1 '^status=server$' /usr/local/directadmin/data/admin/ips | cut -d/ -f8`"
root@server:/usr/local/directadmin/custombuild# echo "$IP"
2a01:aaaa:aaaa:aaaa:0:0:0:1
123.123.123.123
root@server:/usr/local/directadmin/custombuild# if [ "`echo ${IP} | grep -m1 -c ':'`" -gt 0 ]; then IP="[${IP}]"; fi
root@server:/usr/local/directadmin/custombuild# echo "$IP"
[2a01:aaaa:aaaa:aaaa:0:0:0:1
123.123.123.123]

As you could see, my server has two IP-addresses (IPv4 and IPv6) with status "server", which results in a multi-line "$IP" variable and fails in rewriting configs:
  • /etc/proftpd.conf (error on line 23: "ExtendedLog /var/log/proftpd/[2a01:aaaa:aaaa:aaaa:0:0:0:1 123.123.123.123].bytes WRITE,READ userlog")
  • /etc/httpd/conf/extra/httpd-vhosts.conf (error on line 31: "<VirtualHost [2a01:aaaa:aaaa:aaaa:0:0:0:1 123.123.123.123].:80>")
In both configs it's required to have a IPv6 addres between square brackets, which is taken care of with the echo ${IP} | grep -m1 -c ':' IF-statement, but contains all the IP-addresses with the "server"-status.

As I don't have a full overview of the "custombuild" project; I'm not sure if this issues propagates elsewhere.

This issue is found on three different lines, in the "build"-script:
Bash:
root@server:/usr/local/directadmin/custombuild# grep -n "status\=server" build
1046:        MYSQL_ACCESS_HOST="`grep -r -l -m1 '^status=server$' /usr/local/directadmin/data/admin/ips | cut -d/ -f8`"
14321:    IP="`grep -r -l -m1 '^status=server$' /usr/local/directadmin/data/admin/ips | cut -d/ -f8`"
24738:    IP="`grep -r -l -m1 '^status=server$' /usr/local/directadmin/data/admin/ips | cut -d/ -f8`
 
There should only be 1 IP address of type "server" :) I'm not sure how you've got 2?
 
I really have no clue. Wasn't that possible in the past? After running DirectAdmin for years now..

I've delete the IPv6 address and found a "new option" called "Linked IP". Now everything works fine :)

But still, we could add a extra check ;)
 
It wasn't possible to have 2 server IPs. It's possible to link them, add new shared (not server) IPs etc.
 
Back
Top