-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwithnet
37 lines (32 loc) · 865 Bytes
/
withnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# 关闭代理
unset http_proxy
unset https_proxy
unset all_proxy
nowPath=`pwd`
# 初始化conda环境,可直接从~/.bashrc或~/.zshrc中复制 need to edit
__conda_setup="$('/opt/anaconda/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/anaconda/etc/profile.d/conda.sh" ]; then
. "/opt/anaconda/etc/profile.d/conda.sh"
else
export PATH="/opt/anaconda/bin:$PATH"
fi
fi
unset __conda_setup
# 进入本项目的目录并登录
cd ~/p-dot-nju-login # need to edit
conda activate NJUlogin # need to edit
python main.py -i -l pwdLogin -u xxxxxxxxx -w xxxxxxxxx # need to edit
conda deactivate
cd $nowPath
$*
excode=$?
cd ~/p-dot-nju-login # need to edit
conda activate NJUlogin # need to edit
python main.py -o
conda deactivate
cd $nowPath
exit $excode