File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ RUN pip install git+https://github.com/TINF21CS1/python-campusnet@dev
1111COPY grades.sh /app/grades.sh
1212RUN chmod 777 /app/grades.sh; chmod +x /app/grades.sh
1313RUN crontab -l /cron
14- RUN echo "0 7-23 * * * /bin/sh /app/grades.sh\n 0/5 * * * * ping -c 4 www.google.com " >> /cron
14+ RUN echo "0 7-23 * * * /bin/sh /app/grades.sh" >> /cron
1515RUN crontab /cron
1616RUN rm /cron
1717
Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ if [[ -z "${NOTIFY_RECIPIENT}" ]]; then
66 NOTIFY_RECIPIENT=" ${USERNAME} "
77fi
88
9- echo $PASSWORD | openconnect -b --user=$VPNUSERNAME --authgroup=$AUTHGROUP --passwd-on-stdin $HOST
10- echo " $( date +" %b %d %H:%M:%S" ) $HOSTNAME entrypoint.sh[$$ ]: Started openconnect."
119echo -e " root=${USERNAME} \nmailhub=studgate.dhbw-mannheim.de:25\nrewriteDomain=student.dhbw-mannheim.de\nhostname=campusnet.docker.local\nAuthUser=${USERNAME} \nAuthPass=${PASSWORD} \nAuthMethod=LOGIN\nFromLineOverride=yes" > /etc/ssmtp/ssmtp.conf
1210echo -e " root:${USERNAME} :studgate.dhbw-mannheim.de:25" > /etc/ssmtp/revaliases
1311echo " $( date +" %b %d %H:%M:%S" ) $HOSTNAME entrypoint.sh[$$ ]: Updated ssmtp configuration."
Original file line number Diff line number Diff line change 11#! /bin/bash
2+
3+ echo $PASSWORD | openconnect -b --user=$VPNUSERNAME --authgroup=$AUTHGROUP --passwd-on-stdin $HOST
4+ echo " $( date +" %b %d %H:%M:%S" ) $HOSTNAME grades.sh[$$ ]: Started openconnect in background."
25
36python3 -m campusnet $USERNAME $PASSWORD -o table > /tmp/grades.txt
47if [ ! -s grades.txt ]; then
@@ -12,4 +15,7 @@ if [ -s /tmp/diff.txt ]; then
1215else
1316 echo " $( date +" %b %d %H:%M:%S" ) $HOSTNAME grades.sh[$$ ]: No changes detected."
1417fi
15- mv /tmp/grades.txt grades.tx
18+ mv /tmp/grades.txt grades.txt
19+
20+ /usr/bin/killall openconnect
21+ echo " $( date +" %b %d %H:%M:%S" ) $HOSTNAME grades.sh[$$ ]: Killed openconnect."
You can’t perform that action at this time.
0 commit comments