Skip to content

Commit 7f47901

Browse files
authored
Merge pull request #17 from dkramer95/CallLogAPI
Add CallLogAPI script
2 parents 9c97dc9 + 502737c commit 7f47901

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

scripts/termux-call-log

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/data/data/com.termux/files/usr/bin/bash
2+
set -u
3+
4+
PARAM_LIMIT=10
5+
PARAM_OFFSET=0
6+
PARAMS=""
7+
8+
SCRIPTNAME=termux-call-log
9+
10+
show_usage () {
11+
echo "Usage: $SCRIPTNAME [-d] [-l limit] [-o offset]"
12+
echo "List call log history"
13+
echo " -l limit offset in call log list (default: $PARAM_LIMIT)"
14+
echo " -o offset offset in call log list (default: $PARAM_OFFSET)"
15+
exit 0
16+
}
17+
18+
while getopts :hl:o: option
19+
do
20+
case "$option" in
21+
h) show_usage;;
22+
l) PARAM_LIMIT=$OPTARG;;
23+
o) PARAM_OFFSET=$OPTARG;;
24+
?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
25+
esac
26+
done
27+
shift $(($OPTIND-1))
28+
29+
if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
30+
31+
PARAMS="$PARAMS --ei offset $PARAM_OFFSET --ei limit $PARAM_LIMIT"
32+
/data/data/com.termux/files/usr/libexec/termux-api CallLog $PARAMS

0 commit comments

Comments
 (0)