[PC-BSD Commits] r17448 - pcbsd/current/src-sh/warden/scripts/backend

svn at pcbsd.org svn at pcbsd.org
Tue Jun 26 06:46:38 PDT 2012


Author: kris
Date: 2012-06-26 13:46:38 +0000 (Tue, 26 Jun 2012)
New Revision: 17448

Modified:
   pcbsd/current/src-sh/warden/scripts/backend/setupusers.sh
Log:

Fix setting root password in Linux jails



Modified: pcbsd/current/src-sh/warden/scripts/backend/setupusers.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/setupusers.sh	2012-06-26 13:37:28 UTC (rev 17447)
+++ pcbsd/current/src-sh/warden/scripts/backend/setupusers.sh	2012-06-26 13:46:38 UTC (rev 17448)
@@ -40,6 +40,7 @@
   exit 5
 fi
 
+set_warden_metadir
 
 
 # End of error checking, now lets add the users / passwords
@@ -47,11 +48,21 @@
 
 echo "Changing root password on: ${IP}"
 
-echo '#!/bin/sh
+if [ -e "${JMETADIR}/linuxjail" ] ; then
 
+  echo '#!/bin/bash
+echo -e "${ROOTPW}\n${ROOTPW}" | passwd root
+' > "${JDIR}/${IP}/.chpass.sh"
+
+else
+
+  echo '#!/bin/sh
 echo "${ROOTPW}" | pw usermod root -h 0
+' > "${JDIR}/${IP}/.chpass.sh"
 
-' > "${JDIR}/${IP}/.chpass.sh"
+fi
+
+
 chmod 755 "${JDIR}/${IP}/.chpass.sh"
 chroot "${JDIR}/${IP}" /.chpass.sh
 rm "${JDIR}/${IP}/.chpass.sh"



More information about the Commits mailing list