Skip to content
Snippets Groups Projects
Verified Commit 70b3f4bd authored by Recolic Keghart's avatar Recolic Keghart
Browse files

better script

parent cf187cbe
No related branches found
No related tags found
1 merge request!4HUST codebase improvement suggestions
*.*
*
!*/
!Makefile
!README.md
!.gitignore
!init.sh
...@@ -11,6 +11,7 @@ function env_set() { ...@@ -11,6 +11,7 @@ function env_set() {
[ -z ${STUID} ] && echo "STUID must be set (RTFM)" && exit [ -z ${STUID} ] && echo "STUID must be set (RTFM)" && exit
[ -z ${STUNAME} ] && echo "STUNAME must be set (RTFM)" && exit [ -z ${STUNAME} ] && echo "STUNAME must be set (RTFM)" && exit
echo "uploading public key..." echo "uploading public key..."
echo curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/id_rsa.pub" "https://$hust_submit_server_host/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" 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 sleep 2
echo "recover from remote git..." echo "recover from remote git..."
......
...@@ -11,6 +11,7 @@ function env_set() { ...@@ -11,6 +11,7 @@ function env_set() {
[ -z ${STUID} ] && echo "STUID must be set (RTFM)" && exit [ -z ${STUID} ] && echo "STUID must be set (RTFM)" && exit
[ -z ${STUNAME} ] && echo "STUNAME must be set (RTFM)" && exit [ -z ${STUNAME} ] && echo "STUNAME must be set (RTFM)" && exit
echo "uploading public key..." 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" curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/RecolicPC.pub" "https://$hust_submit_server_host/teach/api/uploads/pasetup"
sleep 2 sleep 2
echo "setup git-remote..." echo "setup git-remote..."
......
...@@ -17,4 +17,5 @@ wiki="https://$hust_submit_server_host/teach/api/uploads/" ...@@ -17,4 +17,5 @@ wiki="https://$hust_submit_server_host/teach/api/uploads/"
tarball=$(mktemp -q).tar.bz2 tarball=$(mktemp -q).tar.bz2
bash -c "cd .. && tar cj ${cwd} > ${tarball}" bash -c "cd .. && tar cj ${cwd} > ${tarball}"
echo curl -F "task=${task}" -F "id=${STUID}" -F "name=${STUNAME}" -F "submission=@${tarball}" ${wiki}upload
curl -F "task=${task}" -F "id=${STUID}" -F "name=${STUNAME}" -F "submission=@${tarball}" ${wiki}upload curl -F "task=${task}" -F "id=${STUID}" -F "name=${STUNAME}" -F "submission=@${tarball}" ${wiki}upload
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