build termux-services from external repository
This commit is contained in:
parent
d3cfccddbe
commit
5ea9aa6ab8
@ -1,10 +1,8 @@
|
||||
TERMUX_PKG_HOMEPAGE=https://termux.com/
|
||||
TERMUX_PKG_HOMEPAGE=https://github.com/Neo-Oli/termux-services/
|
||||
TERMUX_PKG_DESCRIPTION="Service daemon for Termux"
|
||||
TERMUX_PKG_VERSION=0.01
|
||||
TERMUX_PKG_VERSION=0.0.3
|
||||
TERMUX_PKG_SHA256=5cb368761401b26e15529f113c8ce0b8e735fa0e911269fb7476cb8d42223c95
|
||||
TERMUX_PKG_SRCURL=https://github.com/Neo-Oli/termux-services/archive/$TERMUX_PKG_VERSION.tar.gz
|
||||
TERMUX_PKG_DEPENDS="coreutils"
|
||||
TERMUX_PKG_PLATFORM_INDEPENDENT=yes
|
||||
|
||||
termux_step_make_install () {
|
||||
cp -p $TERMUX_PKG_BUILDER_DIR/termux-services $TERMUX_PREFIX/bin/
|
||||
mkdir -p $TERMUX_PREFIX/etc/profile.d/
|
||||
cp -p $TERMUX_PKG_BUILDER_DIR/start-services.sh $TERMUX_PREFIX/etc/profile.d/
|
||||
}
|
||||
TERMUX_PKG_BUILD_IN_SRC=yes
|
||||
|
@ -1,2 +0,0 @@
|
||||
export SVDIR=$PREFIX/var/service
|
||||
(termux-services start >/dev/null 2>&1 & )
|
@ -1,47 +0,0 @@
|
||||
#!/data/data/com.termux/files/usr/bin/sh
|
||||
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
|
||||
set -e
|
||||
start(){
|
||||
start-stop-daemon -q -S -b -m -p "$PIDFILE" -x "$DAEMON" -- $DAEMON_OPTS
|
||||
}
|
||||
stop(){
|
||||
start-stop-daemon -K -s 1 -o -p "$PIDFILE" -q
|
||||
tail -f --pid=`cat "$PIDFILE"` /dev/null
|
||||
for f in "$SVDIR"/*/supervise "$SVDIR"/*/log/supervise;do
|
||||
if [ -e "$f" ];then
|
||||
kill -9 `cat "$f"/pid` 2>/dev/null ||:
|
||||
rm -rf "$f"
|
||||
fi
|
||||
done
|
||||
}
|
||||
# Must be a valid filename
|
||||
NAME=termux-serivces
|
||||
PIDFILE="$PREFIX/var/run/$NAME.pid"
|
||||
#This is the command to be run, give the full pathname
|
||||
DAEMON="$PREFIX/bin/applets/runsvdir"
|
||||
DAEMON_OPTS="$SVDIR"
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting daemon: $NAME"
|
||||
start
|
||||
echo "."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping daemon: $NAME"
|
||||
stop
|
||||
echo "."
|
||||
;;
|
||||
restart)
|
||||
echo -n "Restarting daemon: $NAME"
|
||||
stop
|
||||
start
|
||||
echo "."
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: "$1" {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user