-
Notifications
You must be signed in to change notification settings - Fork 2
/
collectSubmission.sh
executable file
·34 lines (31 loc) · 1.1 KB
/
collectSubmission.sh
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
USERNAME=`whoami`
HOMEDIR=/home/$USERNAME
CHRONLOGNAME=.chron_log
CHRONLOG=$HOMEDIR/$CHRONLOGNAME
LOGTAR=git_logs.tar.gz
LOGLOC=.git_nodelete
TARNAME=bufferbloat.tar.gz
PRINTF=printf
if [ -a $TARNAME ]; then
$PRINTF "Removing previous $TARNAME.\n"
rm -f $TARNAME
fi
# ---------- Ask if group would like to include assignment progress info
$PRINTF "Would you like to include logs of your assignment progress?\n"
$PRINTF "These progress logs will be used for education research purposes.\n"
$PRINTF "They *will not* affect your assignment grade.\n"
$PRINTF "Include assignment progress logs [y/n]:\n"
read ANSWER
if [ "$ANSWER" = "Y" -o "$ANSWER" = "y" -o "$ANSWER" = "yes" ]; then
$PRINTF "Including assignment progress logs in your submission tar.\n"
cp $CHRONLOG $LOGLOC
tar -zcf $LOGTAR $LOGLOC
else
$PRINTF "Excluding assignment progress logs in your submission tar.\n"
fi
tar --exclude='./.*' -zcf $TARNAME *
if [ "$ANSWER" = "Y" -o "$ANSWER" = "y" -o "$ANSWER" = "yes" ]; then
rm $LOGTAR
rm $LOGLOC/$CHRONLOGNAME
fi
$PRINTF "Created a tarball of your assignment called $TARNAME.\n"