Cpanel create test accounts: Difference between revisions

From Cheatsheet
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
Answer the questions and go!
Answer the questions and go!


no output:
<pre style="white-space: pre-wrap;">
<pre style="white-space: pre-wrap;">
read -p "Number of accounts to create?" numACCts; read -p "Password to use on all accounts?" acctPaSsWd; CHARS=( q a z w s x e d c r f v t g b y h n u j m i k o l p ); MODNUM=${#CHARS[*]}; LYELLOW=$(echo -en '\033[01;33m'); CYAN=$(echo -en '\033[00;36m'); RESTORE=$(echo -en '\033[0m'); acctcount=0; for i in `eval echo {1..$numACCts}`; do(( acctcount=acctcount+1 )); USRSTR=""; USRLEN=0; for q in {0..7}; do INDEX=$(($RANDOM%$MODNUM)); USRSTR="${USRSTR}${CHARS[$INDEX]}"; done; yes | /scripts/createacct ${USRSTR}.iter $USRSTR $acctPaSsWd > /dev/null 2>&1; echo -ne ${CYAN}"Creating your test accounts:" ${LYELLOW}"$acctcount/$numACCts\033[0K\r"${RESTORE}; done; echo
read -p "Number of accounts to create?" numACCts; read -p "Password to use on all accounts?" acctPaSsWd; CHARS=( q a z w s x e d c r f v t g b y h n u j m i k o l p ); MODNUM=${#CHARS[*]}; LYELLOW=$(echo -en '\033[01;33m'); CYAN=$(echo -en '\033[00;36m'); RESTORE=$(echo -en '\033[0m'); acctcount=0; for i in `eval echo {1..$numACCts}`; do(( acctcount=acctcount+1 )); USRSTR=""; USRLEN=0; for q in {0..7}; do INDEX=$(($RANDOM%$MODNUM)); USRSTR="${USRSTR}${CHARS[$INDEX]}"; done; yes | /scripts/createacct ${USRSTR}.iter $USRSTR $acctPaSsWd > /dev/null 2>&1; echo -ne ${CYAN}"Creating your test accounts:" ${LYELLOW}"$acctcount/$numACCts\033[0K\r"${RESTORE}; done; echo
</pre>
Domain and user output:
<pre style="white-space: pre-wrap;">
read -p "Number of accounts to create?" numACCts; read -p "Password to use on all accounts?" acctPaSsWd; CHARS=( q a z w s x e d c r f v t g b y h n u j m i k o l p ); MODNUM=${#CHARS[*]}; LYELLOW=$(echo -en '\033[01;33m'); CYAN=$(echo -en '\033[00;36m'); RESTORE=$(echo -en '\033[0m'); > /tmp/testAccounts.txt; acctcount=0; for i in `eval echo {1..$numACCts}`; do(( acctcount=acctcount+1 )); USRSTR=""; USRLEN=0; for q in {0..7}; do INDEX=$(($RANDOM%$MODNUM)); USRSTR="${USRSTR}${CHARS[$INDEX]}"; done; yes | /scripts/createacct ${USRSTR}.iter $USRSTR $acctPaSsWd > /dev/null 2>&1; echo "Domain info: ${USRSTR}.iter User: $USRSTR" >> /tmp/testAccounts.txt ; echo -ne ${CYAN}"Creating your test accounts:" ${LYELLOW}"$acctcount/$numACCts\033[0K\r"${RESTORE}; done; echo; cat /tmp/testAccounts.txt
</pre>
</pre>

Revision as of 01:25, 15 June 2018

Use this to create several cpanel test accounts at once.

Answer the questions and go!

no output:

read -p "Number of accounts to create?" numACCts; read -p "Password to use on all accounts?" acctPaSsWd; CHARS=( q a z w s x e d c r f v t g b y h n u j m i k o l p ); MODNUM=${#CHARS[*]}; LYELLOW=$(echo -en '\033[01;33m'); CYAN=$(echo -en '\033[00;36m'); RESTORE=$(echo -en '\033[0m'); acctcount=0; for i in `eval echo {1..$numACCts}`; do(( acctcount=acctcount+1 )); USRSTR=""; USRLEN=0; for q in {0..7}; do INDEX=$(($RANDOM%$MODNUM)); USRSTR="${USRSTR}${CHARS[$INDEX]}"; done; yes | /scripts/createacct ${USRSTR}.iter $USRSTR $acctPaSsWd > /dev/null 2>&1; echo -ne ${CYAN}"Creating your test accounts:" ${LYELLOW}"$acctcount/$numACCts\033[0K\r"${RESTORE}; done; echo

Domain and user output:

read -p "Number of accounts to create?" numACCts; read -p "Password to use on all accounts?" acctPaSsWd; CHARS=( q a z w s x e d c r f v t g b y h n u j m i k o l p ); MODNUM=${#CHARS[*]}; LYELLOW=$(echo -en '\033[01;33m'); CYAN=$(echo -en '\033[00;36m'); RESTORE=$(echo -en '\033[0m'); > /tmp/testAccounts.txt; acctcount=0; for i in `eval echo {1..$numACCts}`; do(( acctcount=acctcount+1 )); USRSTR=""; USRLEN=0; for q in {0..7}; do INDEX=$(($RANDOM%$MODNUM)); USRSTR="${USRSTR}${CHARS[$INDEX]}"; done; yes | /scripts/createacct ${USRSTR}.iter $USRSTR $acctPaSsWd > /dev/null 2>&1; echo "Domain info: ${USRSTR}.iter User: $USRSTR" >> /tmp/testAccounts.txt ; echo -ne ${CYAN}"Creating your test accounts:" ${LYELLOW}"$acctcount/$numACCts\033[0K\r"${RESTORE}; done; echo; cat /tmp/testAccounts.txt