Advertisement
Guest User

Untitled

a guest
Nov 8th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.18 KB | None | 0 0
  1. #!/bin/bash
  2. # Bash Menu Script Example
  3. echo "Please make sure to have the tor browser running for tor-ssh and tor-sshf-mount options!"
  4. PS3='Please enter your choice: '
  5. options=("tor-ssh" "ssh" "tor-sshfs-mount" "sshfs-mount" "sshfs-unmount" "quit")
  6. select opt in "${options[@]}"
  7. do
  8.     case $opt in
  9.         "tor-ssh")
  10.             echo "connecting to ssh with tor"
  11.             ssh -t -o ProxyCommand='nc -x 127.0.0.1:9150 %h %p' buci@buci.cicum.icu
  12.             echo ""
  13.             echo "1) tor-ssh       3) tor-sshf-mount  5) sshf-unmount"
  14.             echo "2) ssh           4) sshf-mount      6) quit"
  15.             ;;
  16.         "ssh")
  17.             echo "connecting to ssh without tor"
  18.             ssh -t buci.cicum.icu
  19.             echo ""
  20.             echo "1) tor-ssh       3) tor-sshf-mount  5) sshf-unmount"
  21.             echo "2) ssh           4) sshf-mount      6) quit"
  22.             ;;
  23.         "tor-sshfs-mount")
  24.             echo "mounting sshfs with tor"
  25.             sshfs -o ProxyCommand='nc -x 127.0.0.1:9150 %h %p' -o nonempty buci@buci.cicum.icu:/ ~/battlestation
  26.             echo ""
  27.             echo "1) tor-ssh       3) tor-sshf-mount  5) sshf-unmount"
  28.             echo "2) ssh           4) sshf-mount      6) quit"
  29.             ;;
  30.         "sshfs-mount")
  31.             echo "mounting sshfs without tor"
  32.             sshfs -o nonempty buci@buci.cicum.icu:/ ~/battlestation
  33.             echo ""
  34.             echo "1) tor-ssh       3) tor-sshf-mount  5) sshf-unmount"
  35.             echo "2) ssh           4) sshf-mount      6) quit"
  36.             ;;
  37.         "sshfs-unmount")
  38.             echo "!!!!you are about to unmount the sshfs mount, save your work before doing so!!!!"
  39.             read -p "press enter to proceed!"
  40.             echo "unmounting sshfs"
  41.             sudo umount -l ~/battlestation
  42.             echo ""
  43.             echo "1) tor-ssh       3) tor-sshf-mount  5) sshf-unmount"
  44.             echo "2) ssh           4) sshf-mount      6) quit"
  45.             ;;
  46.         "quit")
  47.             echo "!!!!the script exits, and the sshfs mount will cease to exist. save your work before quitting!!!!"
  48.             read -p "press enter to quit!"
  49.             break
  50.             ;;
  51.         *) echo "invalid option $REPLY";;
  52.     esac
  53. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement