-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrobo
executable file
·68 lines (46 loc) · 1.5 KB
/
robo
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
63
64
65
66
67
68
#!/usr/bin/env bash
# --------------------- Copyright Block ----------------------
# robo. Personal home tasks automation (ver 0.1)
# Copyright (C) 2017 MMD-SYS
# Author: Mohammad Dahamsih
# Email: [email protected]
# Github: github.com/mdahamshi
# License: GNU LGPL v3.0
# TERMS OF USE:
# Permission is granted to use this code, with or
# without modification, in any website or application
# provided that credit is given to the original work
# with a link back to PrayTimes.org.
# This program is distributed in the hope that it will
# be useful, but WITHOUT ANY WARRANTY.
# PLEASE DO NOT REMOVE THIS COPYRIGHT BLOCK.
dir=$(dirname $(readlink -f "$0"))
cd $dir
function motherDay()
{
$(stop-mplayer)
./play-atte
./set-volume 80
mplayer ./audio/mom.mp3
./voice/robo-speak-no "كُلُّ عام وأَنتِ بخير يا سَيِّدَة أُمُ محمد"
}
function cron-azan()
{
crontab -l > ./data/oldCron
sed '/play-azan/d' ./data/oldCron > ./data/newCron
./python/azan.py
cat ./data/cronAzan >> ./data/newCron
crontab ./data/newCron
}
function get-azan()
{
w3m https://www.islamicfinder.org/world/palestine/45647456/\
jerusalem-region-prayer-times/ > ./data/w3mResult
grep '[0-9][0-9]:[0-9][0-9]' ./data/w3mResult | head -n 6 \
|awk 'BEGIN{FS=":| "}\
NR!=2{/^[0-9]/;\
printf "%d %d * * * play-azan %s\n",\
$2,(NR > 2 && $1 < 10) ? $1 + 12: $1,NR==1? "fajr.mp3" : "azan.mp3"} ' \
> ./data/cronAzan
}
$1