Skip to content
Snippets Groups Projects
Commit a1c8eab8 authored by Mike Boss's avatar Mike Boss
Browse files

Extend cleanup.sh

parent f992d484
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
kill $(ps -u | grep -m1 -- "-L" | grep -- "-N" | awk '{print $2}') if [[ $# -lt 1 ]]
then
echo -e "Error: No ETH username is specified, terminating script\n"
exit 1
fi
ssh -T $1@euler.ethz.ch bkill $(cat reconnect_info | grep BJOB | awk '{print $NF}') VSC_USERNAME=$1
\ No newline at end of file
VSC_TUNNEL=$(cat reconnect_info | grep -o -E '[0-9]+:([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+):[0-9]+')
TUNNEL_JOBS=$(ps -u | grep $VSC_TUNNEL | grep ssh | awk '{ print $2 }')
for TUNNEL_JOB in $TUNNEL_JOBS; do echo $TUNNEL_JOB; kill $TUNNEL_JOB; done
ssh -T $VSC_USERNAME@euler.ethz.ch bkill $(cat reconnect_info | grep BJOB | awk '{print $NF}')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment