#!/bin/bash

TOGGLE_FILE="/tmp/toggle_ssocks"

if [ -f "$TOGGLE_FILE" ]; then
  echo "Enabling spoofdpi"
  killall sslocal
  http_proxy="" spoof-dpi -addr 127.0.0.1 -port 1080 &
  rm "$TOGGLE_FILE"
 
else
  echo "Enabling shadowsocks"
  killall spoof-dpi
  http_proxy="" sslocal -c /etc/shadowsocks-rust/mega.json &
  touch "$TOGGLE_FILE"
 
fi
