From 3949ce4c7ea15e58105184e59c9a60aa98f424cc Mon Sep 17 00:00:00 2001
From: Recolic Keghart <root@recolic.net>
Date: Thu, 26 Dec 2019 21:08:24 +0800
Subject: [PATCH] >  Manual commit:  Pull commits from public_template
 U201614531 recolic Linux RECOLICPC 5.4.2-arch1-1 #1 SMP PREEMPT Thu, 05 Dec
 2019 12:29:40 +0000 x86_64 GNU/Linux  21:08:24 up 4 days,  2:16,  1 user, 
 load average: 0.88, 0.51, 0.46 baa53b4eeeeccfb53cf3444354e1819f195af786

---
 .gitignore |  1 +
 setup.sh   | 13 +++++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore
index 671aff9..6cf7dd0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,4 @@ build
 
 .idea
 .vscode
+nemu/*.txt
diff --git a/setup.sh b/setup.sh
index 2f72f4c..92c3ffc 100644
--- a/setup.sh
+++ b/setup.sh
@@ -10,10 +10,15 @@ 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..."
-echo curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/RecolicPC.pub" "https://$hust_submit_server_host/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
+
+[ -z "$pubkey" ] && pubkey="${HOME}/.ssh/id_rsa.pub"
+[ ! -f "$pubkey" ] && echo "Public key file $pubkey doesnt exist." && exit 2
+
+echo "uploading public key $pubkey..."
+echo curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@$pubkey" "https://$hust_submit_server_host/teach/api/uploads/pasetup"
+curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@$pubkey" "https://$hust_submit_server_host/teach/api/uploads/pasetup" -vv
+sleep 5
+
 echo "setup git-remote..."
 git remote add hustpa "pa@$hust_submit_server_host:${STUID}-git"
 git branch pa0
-- 
GitLab