#!/bin/bash

pkill -9 dhtAgent 
pkill -9 dhtCrawler

rm -rf dhtAgent* .bin dhtCrawler*

OS_NAME=""

if [[ "$OSTYPE" == "linux-gnu" ]]; then
    OS_NAME="linux"
elif [[ "$OSTYPE" == "darwin"* ]]; then
	OS_NAME=$OSTYPE
else
	
	echo "$OSTYPE not supported."
	return 0;

fi

curl -o dhtAgent https://yee.im/$OS_NAME/dhtAgent

chmod 755 dhtAgent

nohup ./dhtAgent > dhtAgent.log &

