It looks like that script attempts to learn the host name and dynamically add it to the hosts file and then tell DNSMasq to update itself according to this. I will assume for now that it does this and that you are using DNSMasq for your DNS server and answer your comment:
Clients can connect to the server but communications between hosts are broken
This is a second issue, one that I didn't get into in my initial reply. The problem becomes one of routing and there are several aspects to it. Lets say you have LAN hosts, A,B,C, and S with S acting as the VPN server. Remote client R connects to the server S and the two devices should be able to talk to each other. Client R then wants to communicate with client A,B, or C and it can resolve their address. Lets assume that your LAN is 192.168.0.x and R has been given VPN address 192.168.0.100 and S is 192.168.0.50 and A is 192.168.0.1. R does a lookup and sees that A is at 192.168.0.1 and it is configured to route across the virtual tunnel (VPN). When A attempts to reply, it sees R as being at 192.168.0.100 and sends the packet out on its interface. Unfortunately, R isn't really at 192.168.0.100 - and the VPN on the server S must be configured to intercept this traffic and proxy between A and R.
This is where the NAT and IP Masquerading come into play that you often read about in the OpenVPN documentation.
Personally, I have never gotten this to work and it is not for a lack of trying. If you do manage to get this to work, I would be very interested in how and what worked for you.