2015-08-14 21:27:47 +02:00
|
|
|
#!/bin/sh
|
2015-06-13 01:03:31 +02:00
|
|
|
set -e -u
|
|
|
|
|
2016-04-20 01:00:08 +02:00
|
|
|
SCRIPTNAME=termux-vibrate
|
2015-06-13 01:03:31 +02:00
|
|
|
show_usage () {
|
2016-04-26 01:37:45 +02:00
|
|
|
echo "Usage: $SCRIPTNAME [-d duration] [-f]"
|
|
|
|
echo "Vibrate the device."
|
|
|
|
echo ""
|
|
|
|
echo " -d duration the duration to vibrate in ms (default:1000)"
|
|
|
|
echo " -f force vibration even in silent mode"
|
|
|
|
echo ""
|
|
|
|
exit 0
|
2015-06-13 01:03:31 +02:00
|
|
|
}
|
|
|
|
|
2016-04-20 01:00:08 +02:00
|
|
|
PARAMS=""
|
|
|
|
|
|
|
|
while getopts :hfd: option
|
|
|
|
do
|
|
|
|
case "$option" in
|
|
|
|
h) show_usage;;
|
|
|
|
d) PARAMS="$PARAMS --ei duration_ms $OPTARG";;
|
|
|
|
f) PARAMS="$PARAMS --ez force true";;
|
|
|
|
?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
|
|
|
|
esac
|
2015-06-13 01:03:31 +02:00
|
|
|
done
|
2016-04-20 01:00:08 +02:00
|
|
|
shift $(($OPTIND-1))
|
|
|
|
|
|
|
|
if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
|
2015-06-13 01:03:31 +02:00
|
|
|
|
2016-04-20 01:00:08 +02:00
|
|
|
@TERMUX_API@ Vibrate $PARAMS
|