Advertisement
Guest User

tv-script

a guest
Jul 10th, 2023
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | Food | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. pidfile=/var/tmp/tv.pid
  4. function killssh(){
  5. if [[ -f ${1} ]]; then
  6. local _pid=$(cat $1)
  7. if ps -o pid,cmd -p $_pid > /dev/null 2>&1 ; then
  8. kill -9 $_pid
  9. fi
  10. rm -f $1
  11. fi
  12. }
  13.  
  14. killssh $pidfile
  15. nohup ssh -D *:8080 -N user@ip &
  16. pid=$!
  17. echo $pid > $pidfile
  18. /opt/google/chrome/google-chrome --user-data-dir=$HOME/.config/google-chrome-tv --profile-directory=tv --args --proxy-server=socks5://127.0.0.1:8080
  19.  
  20. killssh $pidfile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement