Termux service love

This commit is contained in:
Geoffrey Frogeye 2017-09-17 11:36:17 +00:00
parent 75462e7e5d
commit caf49db140
7 changed files with 95 additions and 5 deletions

22
termux/scripts/service Executable file
View file

@ -0,0 +1,22 @@
#!/data/data/com.termux/files/usr/bin/bash
#
# Run & stop Termux services
#
if [ $# -lt 1 ]
then
echo "Expected a service name as first argument."
exit 1
fi
service="$1"
file="$HOME/.termux/services/$1"
if [ -f "$file" ]
then
shift
$file "$@"
else
echo "Service not found: $1"
fi