sxiii

Script How-To Fix Display Manager By Chroot On Broken System

Jan 18th, 2013
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.98 KB | None | 0 0
  1. #!/bin/bash
  2. # This script is intended to fix or change your display manager
  3. # It just chroots to your $device system and prints to you current
  4. # default display manager so you could change everything up.
  5. # Written on 18 january 2013 by Security XIII [at gmail dot com]
  6. # when I had a problem of not loading the DM (xdm broke my system somehow)
  7.  
  8. # You can change a bit this if you want to
  9. # If you have separate /boot partition you MAYBE have to include it
  10.  
  11. device="/dev/sda1"
  12. cmd="sudo mount"
  13. cmd2="$cmd --bind"
  14. fsname="/mnt"
  15. dev="/dev"
  16. proc="/proc"
  17. sys="/sys"
  18.  
  19. # Stop changing here, please.
  20.  
  21. $cmd $device $fsname
  22. $cmd2 $dev $fsname$dev
  23. $cmd2 $proc $fsname$proc
  24. $cmd2 $sys $fsname$sys
  25.  
  26. sudo chroot $fsname
  27.  
  28. dm=$(cat /etc/X11/default-display-manager)
  29. echo "Your current display manager is: $dm"
  30. echo "To change it, run nano /etc/X11/default-display-manager and edit manually"
  31. echo "To save in nano, press Ctrl+O and enter"
  32. echo "Recommended: /usr/sbin/gdm or /usr/sbin/lightdm"
Advertisement
Add Comment
Please, Sign In to add comment