Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- read -p $'[+] Please enter how many accounts you want to assign with a passwords:\n' ACCOUNTS
- read -p $'[+] Do you want to store the log-in location of your Accounts [y/n]:\n' CHECK_LOCATION
- declare -i y=ACCOUNTS
- counter=1
- function generate () {
- PASS=$(pwgen -n -y -c $PASSLENGHT 1)
- echo $PASS
- }
- if test $y == 1
- then
- read -p $'[+]Please enter the password length:\n' PASSLENGHT
- read -p $'[+]Please enter email or username to assign the generated password:\n ' USERNAME
- PASSWORD=$(generate)
- if [ "$CHECK_LOCATION" == "y" ]
- then
- read -p $'[+]Please enter the url for the generated pair: \n ' LOCATION
- echo "[+]The password $PASSWORD is assign to $USERNAME for $LOCATION "
- echo "Location: $LOCATION Username: $USERNAME Password: $PASSWORD" >> Accounts.txt
- else
- echo "[+]The password $PASSWORD is assign to $USERNAME "
- echo "Username: $USERNAME Password: $PASSWORD" >> Accounts.txt
- fi
- elif test $y > 1
- then
- while [[ $y > 0 ]]; do
- if [ "$CHECK_LOCATION" == "y" ]
- then
- read -p $'[+]Please enter the password length: \n ' PASSLENGHT ;
- PASSWORD_MORE=$(generate)
- read -p $'[+]Please enter email or username to assign the generated password:\n ' USERNAME
- read -p $'[+]Please enter the url for the generated pair:\n ' LOCATION
- echo "[+]The password $PASSWORD_MORE is assign to $USERNAME for $LOCATION"
- echo "Location: $LOCATION Username: $USERNAME Password: $PASSWORD_MORE" >> Accounts.txt
- else
- read -p $'[+]Please enter the password length: \n ' PASSLENGHT ;
- PASSWORD_MORE=$(generate)
- read -p $'[+]Please enter email or username to assign the generated password: \n' USERNAME
- echo "[+]The password $PASSWORD_MORE is assign to $USERNAME "
- echo "Username: $USERNAME Password: $PASSWORD_MORE" >> Accounts.txt
- fi
- ((y--))
- ((counter++))
- done
- else
- exit
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement