Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo "user_name;card_number;policy_number;ext_ref_number;provider_id;group_code;activation_id;last_login_dttm;registration_dttm;activation_dttm;activation_notes;rejection_notes;reference_number;mobile_number;activation_status_id;email_address;mobile_activation_code;mobile_activation_status;mobile_last_login_dttm;mobile_login_count;country_code;source;emirates_id;smartpass_uuid;first_name;last_name;user_password" >Thiqa_users_online.withPasswords.csv && \
- li=0 && \
- for rawline in $(sed s/' '/'_______'/g Thiqa_users_online.csv); do
- line=$(echo ${rawline} | sed -e s/'[\n\r]'//g)
- if [ ${li} -ne 0 ]; then
- if [ ${#line} -gt 180 ]; then
- username=$(echo ${line} | sed -r s/'^([^;]+);.+'/'\1'/g)
- if [ $(echo ${username} | grep -iv "_______" | wc -l) -gt 0 ]; then
- password=$(grep -A 5 "uid: ${username}" Thiqa_users_PRd_NOPASSWORD.ldif | grep -i userPassword | sed s/'userPassword: '/''/g)
- if [ ${#password} -gt 1 ]; then
- echo "${line};${password}" | sed s/'_______'/' '/g >>Thiqa_users_online.withPasswords.csv
- else
- echo "${line};" | sed s/'_______'/' '/g >>Thiqa_users_online.withPasswords.csv
- fi
- else
- echo ${line} | sed s/'_______'/' '/g >>Thiqa_users_online.withPasswords.csv
- fi
- else
- echo ${line} | sed s/'_______'/' '/g >>Thiqa_users_online.withPasswords.csv
- fi
- fi
- li=$[li+1]
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement