mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

sandboxed-browser-mount (459B)


      1 #!/bin/bash
      2 
      3 # need to create browser2 user
      4 # you may also want to add the local user to the browser2 group
      5 
      6 ENDPOINT="$HOME/mnt/browser2"
      7 
      8 mkdir -p "$ENDPOINT"
      9 
     10 grep -qs " $ENDPOINT " /proc/mounts || (
     11   echo "$ENDPOINT was not mounted, mounting it"
     12   sudo bindfs --create-for-user=$(id -u browser2) \
     13     --create-for-group=$(id -g browser2) \
     14     --chown-deny --chgrp-deny --chmod-deny -p '700' \
     15     -u $(id -u) -g $(id -g) \
     16     ~browser2 "$ENDPOINT"
     17 )
     18