diff --git a/Makefile b/Makefile index 80bc763b140364df57fdd28a9637fdf530234d6e..e7239c44a91c570c310e170487772be09e3e94a2 100644 --- a/Makefile +++ b/Makefile @@ -11,13 +11,13 @@ clean: submit: clean git gc - STUID=$(STUID) STUNAME=$(STUNAME) bash submit.sh + STUID=$(STUID) STUNAME=$(STUNAME) hust_submit_server_host=cernet.cnm.cool bash submit.sh setup: - STUID=$(STUID) STUNAME=$(STUNAME) bash setup.sh + STUID=$(STUID) STUNAME=$(STUNAME) hust_submit_server_host=cernet.cnm.cool bash setup.sh recover: - STUID=$(STUID) STUNAME=$(STUNAME) bash recover.sh + STUID=$(STUID) STUNAME=$(STUNAME) hust_submit_server_host=cernet.cnm.cool bash recover.sh .PHONY: default clean submit diff --git a/recover.sh b/recover.sh index 64f7fb7b0e7b5b6780de2d4c85db638f52aa95b4..75b382ff56ab138d5e9f5a0531fe450450184715 100644 --- a/recover.sh +++ b/recover.sh @@ -1,3 +1,8 @@ +# Recolic CERNET proxy service: +# dssl.cun.io is not available in public Internet. So you have to use my proxy: cernet.cnm.cool. +# If variable is not set, use original version. +[ "$hust_submit_server_host" = "" ] && hust_submit_server_host=dssl.cun.io + function env_set() { sed -i -e "/^export $2=.*/d" ~/.bashrc echo "export $2=`readlink -e $1`" >> ~/.bashrc @@ -6,10 +11,10 @@ function env_set() { [ -z ${STUID} ] && echo "STUID must be set (RTFM)" && exit [ -z ${STUNAME} ] && echo "STUNAME must be set (RTFM)" && exit echo "uploading public key..." -curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/id_rsa.pub" https://dssl.cun.io/teach/api/uploads/pasetup +curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/id_rsa.pub" "https://$hust_submit_server_host/teach/api/uploads/pasetup" sleep 2 echo "recover from remote git..." -git remote add hustpa pa@dssl.cun.io:${STUID}-git +git remote add hustpa "pa@$hust_submit_server_host:${STUID}-git" git fetch hustpa git branch -d pa0 git branch -d pa1 diff --git a/setup.sh b/setup.sh index b2647762ea0b23e3ec2a18b5fc9d6b26a64dfc23..110c3eb54d54603eeb8465534b3a11dbc0daeac0 100644 --- a/setup.sh +++ b/setup.sh @@ -1,3 +1,8 @@ +# Recolic CERNET proxy service: +# dssl.cun.io is not available in public Internet. So you have to use my proxy: cernet.cnm.cool. +# If variable is not set, use original version. +[ "$hust_submit_server_host" = "" ] && hust_submit_server_host=dssl.cun.io + function env_set() { sed -i -e "/^export $2=.*/d" ~/.bashrc echo "export $2=`readlink -e $1`" >> ~/.bashrc @@ -6,10 +11,10 @@ function env_set() { [ -z ${STUID} ] && echo "STUID must be set (RTFM)" && exit [ -z ${STUNAME} ] && echo "STUNAME must be set (RTFM)" && exit echo "uploading public key..." -curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/id_rsa.pub" https://dssl.cun.io/teach/api/uploads/pasetup +curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/RecolicPC.pub" "https://$hust_submit_server_host/teach/api/uploads/pasetup" sleep 2 echo "setup git-remote..." -git remote add hustpa pa@dssl.cun.io:${STUID}-git +git remote add hustpa "pa@$hust_submit_server_host:${STUID}-git" git branch pa0 git branch pa1 git branch pa2 diff --git a/submit.sh b/submit.sh index 84ed945eb7f90a89ff78bcc1ff42b7a597f7d051..380b66435b054c1649e09f4b9e4c5500afc46bab 100644 --- a/submit.sh +++ b/submit.sh @@ -1,3 +1,8 @@ +# Recolic CERNET proxy service: +# dssl.cun.io is not available in public Internet. So you have to use my proxy: cernet.cnm.cool. +# If variable is not set, use original version. +[ "$hust_submit_server_host" = "" ] && hust_submit_server_host=dssl.cun.io + set -e [ -z ${STUID} ] && echo "STUID must be set (RTFM)" && exit @@ -8,7 +13,7 @@ read task cwd=${PWD##*/} echo "${STUID} (${STUNAME}) submitting ${task}..." -wiki='https://dssl.cun.io/teach/api/uploads/' +wiki="https://$hust_submit_server_host/teach/api/uploads/" tarball=$(mktemp -q).tar.bz2 bash -c "cd .. && tar cj ${cwd} > ${tarball}"