#!/bin/bash # bdpath=/opt/automa # bdusers=(`cat $bdpath/users.txt`) # . . fs=(`echo ${bdusers[0]} | sed -e 's/^.[a-zA-Z]\{0\}//'`) # a=0 b=`expr $a + 1` c=`expr $b + 1` # . bdusers[0]=$fs # tab="xdotool key --delay 300 "Tab"" shifttab="xdotool key --delay 300 --clearmodifiers "Shift+Tab"" # while [ ${bdusers[$a]} ] do # . #echo "All is right?" && read # /usr/bin/google-chrome - https://pfsense.loc/system_usermanager.php?act=new sleep 3 # name1="${bdusers[$c]}" name2="${bdusers[$b]}" login="${bdusers[$a]}" pass=`pwgen -1n` # # Username i=0 while [ "$i" != "9" ] do $tab i=`expr $i + 1` done # xdotool type $login # Password xdotool key --delay 200 "Tab" # xdotool type $pass xdotool key --delay 200 "Tab" xdotool type $pass # Full Name xdotool key --delay 200 "Tab" # xdotool type $name1 # xdotool key space # xdotool type $name2 # Click to create a user certificate. i=0 while [ "$i" != "7" ] do $tab i=`expr $i + 1` done # Click to create a user certificate. xdotool key space # Descriptive name xdotool key --delay 30 "Tab" # xdotool type $name1 # xdotool key space # xdotool type $name2 # Save i=0 while [ "$i" != "6" ] do $tab i=`expr $i + 1` done # Save xdotool key "Return" # xdotool key "Ctrl+w" # /usr/bin/google-chrome — https://pfsense.loc/vpn_openvpn_export.php sleep 3 # i=0 while [ "$i" != "6" ] do $shifttab i=`expr $i + 1` done # xdotool key "Return" sleep 2 # /home/user/temp/ xdotool key slash xdotool type "home" xdotool key slash xdotool type "user" xdotool key slash xdotool type "temp" xdotool key slash xdotool type "vpn-TCP-1194-config" # Enter xdotool key "Return" sleep 3 # xdotool key "Ctrl+w" # , sendemail -f admin@company.ru -t $login@company.ru -o message-charset=utf-8 -o message-content-type=html -u "NewVPN Settings" -m "<p> .<br> VPN . .</p><p>name - $login <br> pass - $pass"\ -s mail.company.ru -xu admin@company.ru -xp password -a instruction.doc /home/user/temp/vpn-TCP-1194-config.zip # rm /home/user/temp/vpn-TCP-1194-config.zip a=`expr $a + 3` b=`expr $b + 3` c=`expr $c + 3` done
#!/bin/bash # bdpath=/opt/automa # bdusers=(`cat $bdpath/users.txt`) # . . fs=(`echo ${bdusers[0]} | sed -e 's/^.[a-zA-Z]\{0\}//'`) # a=0 b=`expr $a + 1` c=`expr $b + 1` # . bdusers[0]=$fs # tab="xdotool key --delay 300 "Tab"" shifttab="xdotool key --delay 300 --clearmodifiers "Shift+Tab"" # while [ ${bdusers[$a]} ] do # . #echo "All is right?" && read # /usr/bin/google-chrome - https://pfsense.loc/system_usermanager.php?act=new sleep 3 # name1="${bdusers[$c]}" name2="${bdusers[$b]}" login="${bdusers[$a]}" pass=`pwgen -1n` # # Username i=0 while [ "$i" != "9" ] do $tab i=`expr $i + 1` done # xdotool type $login # Password xdotool key --delay 200 "Tab" # xdotool type $pass xdotool key --delay 200 "Tab" xdotool type $pass # Full Name xdotool key --delay 200 "Tab" # xdotool type $name1 # xdotool key space # xdotool type $name2 # Click to create a user certificate. i=0 while [ "$i" != "7" ] do $tab i=`expr $i + 1` done # Click to create a user certificate. xdotool key space # Descriptive name xdotool key --delay 30 "Tab" # xdotool type $name1 # xdotool key space # xdotool type $name2 # Save i=0 while [ "$i" != "6" ] do $tab i=`expr $i + 1` done # Save xdotool key "Return" # xdotool key "Ctrl+w" # /usr/bin/google-chrome — https://pfsense.loc/vpn_openvpn_export.php sleep 3 # i=0 while [ "$i" != "6" ] do $shifttab i=`expr $i + 1` done # xdotool key "Return" sleep 2 # /home/user/temp/ xdotool key slash xdotool type "home" xdotool key slash xdotool type "user" xdotool key slash xdotool type "temp" xdotool key slash xdotool type "vpn-TCP-1194-config" # Enter xdotool key "Return" sleep 3 # xdotool key "Ctrl+w" # , sendemail -f admin@company.ru -t $login@company.ru -o message-charset=utf-8 -o message-content-type=html -u "NewVPN Settings" -m "<p> .<br> VPN . .</p><p>name - $login <br> pass - $pass"\ -s mail.company.ru -xu admin@company.ru -xp password -a instruction.doc /home/user/temp/vpn-TCP-1194-config.zip # rm /home/user/temp/vpn-TCP-1194-config.zip a=`expr $a + 3` b=`expr $b + 3` c=`expr $c + 3` done
Source: https://habr.com/ru/post/132106/
All Articles