Skip to content

Instantly share code, notes, and snippets.

@carlwiedemann
Created November 7, 2012 23:40
Show Gist options
  • Save carlwiedemann/4035400 to your computer and use it in GitHub Desktop.
Save carlwiedemann/4035400 to your computer and use it in GitHub Desktop.
Drush login, Drush logout
# Drush login function dli
# ------------------------
#
# Open the given site in the browser, login as root, and go to destination
# argument. Requires the -l option, or drush site-set @alias, or $options['l']
# in sites/default/bashrc.php
#
# Usage
# -----
#
# # Simply login as root.
# $> dli
#
# # Login as root and go to /admin/content/node
# $> dli admin/content/node
#
function dli {
open `drush uli`/login?destination=$1
}
# Drush logout function dlo
# ------------------------
#
# Open the given site in the browser, logs out, and goes to destination argument.
# Requires the -l option, or drush site-set @alias, or $options['l'] in
# sites/default/bashrc.php
#
# Usage
# -----
#
# # Simply logout
# $> dlo
#
# # Logout and go to /admin/content/node
# $> dli admin/content/node
#
function dlo {
open http://`drush st --pipe | grep site_uri | replace site_uri= ''`/user/logout?destination=$1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment