SHARE
TWEET

Untitled

a guest Jun 8th, 2017 37 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. username=$USERNAME
  3. password=$PASSWORD
  4.  
  5. NEW_USERS=test
  6. PASSWORD=test
  7. HOME_BASE="/home/"
  8.  
  9. useradd -p ${PASSWORD} -m -d ${HOME_BASE}${NEW_USERS} ${NEW_USERS}
  10. echo "test:test" | chpasswd
  11.  
  12.  
  13. (this one works, it creates a user test with password test)
  14.  
  15. but i want it like this:
  16. -----------------------------------------------------------------
  17.  
  18. #!/bin/bash
  19. username=$USERNAME
  20. password=$PASSWORD
  21.  
  22. NEW_USERS=$USERNAME
  23. PASSWORD=$PASSWORD
  24. HOME_BASE="/home/"
  25.  
  26. useradd -p ${PASSWORD} -m -d ${HOME_BASE}${NEW_USERS} ${NEW_USERS}
  27. echo "$USERNAME:$PASSWORD" | chpasswd
  28.  
  29. this one does not work :( it doesn't pass the variable but when i do "echo $username" it does give the correct value.
  30. $USERNAME & $PASSWORD are set by a php script.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top