Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- username=$USERNAME
- password=$PASSWORD
- NEW_USERS=test
- PASSWORD=test
- HOME_BASE="/home/"
- useradd -p ${PASSWORD} -m -d ${HOME_BASE}${NEW_USERS} ${NEW_USERS}
- echo "test:test" | chpasswd
- (this one works, it creates a user test with password test)
- but i want it like this:
- -----------------------------------------------------------------
- #!/bin/bash
- username=$USERNAME
- password=$PASSWORD
- NEW_USERS=$USERNAME
- PASSWORD=$PASSWORD
- HOME_BASE="/home/"
- useradd -p ${PASSWORD} -m -d ${HOME_BASE}${NEW_USERS} ${NEW_USERS}
- echo "$USERNAME:$PASSWORD" | chpasswd
- this one does not work :( it doesn't pass the variable but when i do "echo $username" it does give the correct value.
- $USERNAME & $PASSWORD are set by a php script.
Add Comment
Please, Sign In to add comment