-# Copy martyn's password from the host
-grep -v '^martyn' ${VSROOT}/etc/shadow > /vserver/.shadow
-grep '^martyn' /etc/shadow >> /vserver/.shadow
-mv /vserver/.shadow ${VSROOT}/etc/shadow
-
# Add a /etc/hosts entry on the HostOS
cat /etc/hosts > /etc/hosts.new
-echo "${VSIPADDR} ${VSNAME}" >> /etc/hosts.new
+echo "${VSIPADDR} ${VSNAME}.$(hostname -f) ${VSNAME}" >> /etc/hosts.new
mv /etc/hosts.new /etc/hosts
+
+# Copy the user's password from the host
+grep -v "^${PROFILEOPTION_username}" ${VSROOT}/etc/shadow > /vserver/.shadow
+grep "^${PROFILEOPTION_username}" /etc/shadow >> /vserver/.shadow
+mv /vserver/.shadow ${VSROOT}/etc/shadow