mybin

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

sandboxed-browser (474B)


      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 # replace by ACLs
     11 grep -qs " $ENDPOINT " /proc/mounts || (
     12   echo "$ENDPOINT was not mounted, mounting it"
     13   sandboxed-browser-mount
     14 )
     15 
     16 # escape all arguments; is there a better way?
     17 ESC=""
     18 for var
     19 do
     20   ESCA=$(printf %q "$var")
     21   ESC="$ESC $ESCA"
     22 done
     23 exec sudo -u browser2 sh -c "umask 007; exec firefox $ESC"
     24