Advertisement
jor_teron

test.sh

Aug 6th, 2022 (edited)
738
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # test script
  3.  
  4.  
  5. prepchroot(){
  6. chrootdir='/home/user/@userdata/chroot' ;
  7. x="proc dev/pts sys" ;
  8.  
  9. for i in $x; do
  10. sudo mount --verbose --bind /$i $chrootdir/$1-chroot/$i ;
  11. echo "Mounted: /$i";
  12. done;
  13.  
  14. if [ -z $DISPLAY ]; then export DISPLAY=':0.0' && echo "setting= $DISPLAY" ; else echo "exist= $DISPLAY" ; fi#set disk size, if not already set
  15. xhost +
  16. }
  17.  
  18. chrootumnt(){
  19. chrootdir='/home/user/@userdata/chroot' ;
  20. x="proc dev/pts sys" ;
  21.  
  22. for i in $x; do
  23. sudo umount --verbose $chrootdir/$1-chroot/$i ;
  24. echo "Unmounted: /$i";
  25. done;
  26. }
  27.  
  28. prepchroot $1
  29. #chrootumnt $1
  30.  
  31.  
  32. #pkexec chroot ~/@userdata/chroot/debian-chroot /usr/bin/firefox --display=:0.0 > /dev/null 2>&1 &
  33. # gnome-system-monitor stacer glances
  34. # sudo chroot --userspec=1000:1000 debian-chroot sudo /usr/bin/login -f user
  35. # sudo chroot debian-chroot /usr/bin/sudo /usr/bin/login -f user
Advertisement
RAW Paste Data Copied
Advertisement