-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathupdate_web_twrp
More file actions
executable file
·48 lines (40 loc) · 1.01 KB
/
update_web_twrp
File metadata and controls
executable file
·48 lines (40 loc) · 1.01 KB
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
#!/bin/bash
## Root of CM project directory
PROJECT_DIR=~/android/system/android-7.1
## Changelog location
CHANGE_FILE=~/android/changelog-twrp.html
## Device name
ANDROID_DEVICE=gts210vewifi
## End Edit
OUTDIR=$PROJECT_DIR/out/target/product/$ANDROID_DEVICE
if [ ! -e "$OUTDIR" ]; then
echo "No build detected. Exiting."
exit
fi
## Find file name of ROM and set variable
cd "$OUTDIR"
FILE=$(ls recovery.img)
NOW=$(date +%Y-%m-%d)
## Check if ROM exists before proceding
if [ ! -e "$FILE" ]; then
echo "Build Failed!"
if [ -e `which send_mail_twrp` ]; then
echo ""
echo "Automatic email notification sent for failed build!"
SUBJECT="TWRP Build Failed on $NOW"
send_mail_twrp "$SUBJECT"
notify-send "$SUBJECT"
fi
exit
fi
echo "Build Successful!"
if [ -e `which send_mail_twrp` ]; then
echo ""
echo "Automatic email notification sent for successful build."
SUBJECT="Build Successful for TWRP on $NOW"
send_mail_twrp "$SUBJECT"
notify-send "$SUBJECT"
fi
echo ""
echo "Done."
echo ""