Advertisement
rtl8192

/usr/bin/stretch

Apr 5th, 2017
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.88 KB | None | 0 0
  1. #!/bin/sh
  2. xhost +
  3. CHROOT="/home/ff/.stretch"
  4.  
  5. [ `whoami` == "root" ] || (echo Must be root && exit 2)
  6.  
  7. [ -n "$(mount | grep $CHROOT/proc)" ]     || mount -t proc /proc $CHROOT/proc
  8. [ -n "$(mount | grep $CHROOT/sys)" ]      || mount -R /sys $CHROOT/sys
  9. [ -n "$(mount | grep $CHROOT/dev)" ]      || mount -R /dev $CHROOT/dev
  10. [ -n "$(mount | grep $CHROOT/tmp)" ]      || mount -R /tmp $CHROOT/tmp
  11. [ -n "$(mount | grep $CHROOT /run)" ]     || mount --bind /run $CHROOT/run
  12. [ -n "$(mount | grep $CHROOT/run/udev)" ] || mount -R /run/udev $CHROOT/run/udev
  13. [ -n "$(mount | grep $CHROOT/root)" ]     || mount -R /home/ff/.steam $CHROOT/root/.steam
  14. #[ -d "$CHROOT/var/run/dbus" ] ||
  15. mount -o bind /var/run/dbus $CHROOT/run/dbus
  16. #[ -f $CHROOT/var/run/dbus/system_bus_socket ] || chroot $CHROOT dbus-launch
  17.  
  18. COMMAND="bash -i"
  19. case $1 in
  20.     "X")     COMMAND="startx";;
  21.     "con")   COMMAND="bash -i";;
  22.     "steam") COMMAND="bash -c /usr/local/bin/bashrc.steam";;
  23. esac
  24.  
  25. chroot $CHROOT $COMMAND
  26.  
  27. umount -l $CHROOT/run/dbus
  28. umount -l $CHROOT/root/.steam
  29. umount -l $CHROOT/run/udev
  30. umount -l $CHROOT/tmp
  31. umount -l $CHROOT/dev
  32. umount -l $CHROOT/sys
  33. umount -l $CHROOT/proc
  34.  
  35.  
  36.  
  37. root@rtl8192:/home/ff# stretch
  38. access control disabled, clients can connect from any host
  39. /usr/bin/stretch: 5: [: root: unexpected operator
  40. Must be root
  41. grep: /run: Это каталог
  42. root@rtl8192:/# service bumblebeed start
  43. Running in chroot, ignoring request.
  44. Running in chroot, ignoring request.
  45. Running in chroot, ignoring request.
  46. Running in chroot, ignoring request.
  47. Running in chroot, ignoring request.
  48. Running in chroot, ignoring request.
  49. Running in chroot, ignoring request.
  50. Running in chroot, ignoring request.
  51. Running in chroot, ignoring request.
  52. Running in chroot, ignoring request.
  53. Running in chroot, ignoring request.
  54. Running in chroot, ignoring request.
  55. Running in chroot, ignoring request.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement