Skip to content

Instantly share code, notes, and snippets.

View visabhishek's full-sized avatar
💭
I may be slow to respond.

Abhishek visabhishek

💭
I may be slow to respond.
View GitHub Profile
#!/bin/bash
drush sqlq "SELECT DISTINCT(SELECT name from users where uid = ur.uid) FROM users_roles AS ur WHERE ur.rid IN (4) LIMIT 50" | while read username;
do
echo "Updating Password for Users $username"
drush upwd $username --password='Pass@123'
# or do whatever with individual element of the array
done
@nkgokul
nkgokul / for_all_content_types_in_drupal.sh
Created August 5, 2015 11:30
For all content types in drupal
#!/bin/bash
drush sqlq "select type from node_type" | while read content_type;
do
echo "Changing comment settings for $content_type"
drush vset comment_default_mode_$content_type 0
drush vset comment_default_per_page_$content_type 50
drush vset comment_$content_type 2
drush vset comment_form_location_$content_type 1
drush vset comment_preview_$content_type 0
drush vset comment_subject_field_$content_type 0