-
Notifications
You must be signed in to change notification settings - Fork 1
/
monday.sh
62 lines (61 loc) · 1.99 KB
/
monday.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
classOne=$(date -d "08:00" +%s)
classTwo=$(date -d "10:00" +%s)
classThree=$(date -d "11:40" +%s)
classFour=$(date -d "14:05" +%s)
classFive=$(date -d "17:00" +%s)
newDay=$(date -d "23:59" +%s)
differenceOne=$((classOne - $(date +%s)))
differenceTwo=$((classTwo - $(date +%s)))
differenceThree=$((classThree - $(date +%s)))
differenceFour=$((classFour - $(date +%s)))
differenceFive=$((classFive- $(date +%s)))
if [ $differenceOne -lt 0 ]
then
#You missed Class One, Check for second class
if [ $differenceTwo -lt 0 ]
then
#You missed Class Two, Check for Third class
if [ $differenceThree -lt 0 ]
then
#You missed Class Three, Check for Fourth class
if [ $differenceFour -lt 0 ]
then
#You missed Class Four, Check for Five class
if [ $differenceFive -lt 0 ]
then
#You missed Class Five, All classes Missed
echo "Waiting for Tomorrow"
echo "Sleeping for $((newDay - $(date +%s))) seconds"
sleep $((newDay+60 - $(date +%s)))
./tuesday.sh
else
echo "Waiting for [Class 5: Physics Theory] to Start"
sleep $differenceFive
python physicsTHE.py
./master.sh
fi
else
echo "Waiting for [Class 4: Electronics Theory] to Start"
sleep $differenceFour
python electronicsTHE.py
./master.sh
fi
else
echo "Waiting for [Class 3: Electronics LAB] to Start"
sleep $differenceThree
python electronicsLAB.py
./master.sh
fi
else
echo "Waiting for [Class 2: Ethnus] to Start"
sleep $differenceTwo
python ethnus.py
./master.sh
fi
else
echo "Waiting for [Class 1: Python] to Start"
sleep $differenceOne
python pythonLAB.py
./master.sh
fi
$SHELL