diff --git a/README.md b/README.md index fd9a39a..3b9a847 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ BSD fetch $ fetch -q -o - ifconfig.co 127.0.0.1 -Pass the appropriate flag (usually -4 and -6) to your tool to switch between +Pass the appropriate flag (usually -4 and -6) to your tool to switch between IPv4 and IPv6 lookup. Features @@ -30,10 +30,6 @@ Features * Fast * Supports typical CLI tools (curl, wget and fetch) -Dependencies (optional) -======================= -* Daemonize script depends on https://github.com/bmc/daemonize - Why? ==== * To scratch an itch diff --git a/daemonize.sh b/daemonize.sh deleted file mode 100755 index f491311..0000000 --- a/daemonize.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash - -NAME="ifconfig" -PREFIX=$(dirname $(readlink -f $0)) -DAEMON="$PREFIX/$NAME" -PID_FILE="${PREFIX}/tmp/${NAME}.pid" -LOCK_FILE="${PREFIX}/tmp/${NAME}.lock" -LOG_FILE="${PREFIX}/tmp/${NAME}.log" - -E_USAGE=1 -E_NOTFOUND=2 - -if [[ ! -x "$DAEMON" ]]; then - echo "$DAEMON does not exist or is not executable" - exit $E_NOTFOUND -fi - -start () { - echo -n "Starting $NAME: " - mkdir -p $PREFIX/tmp - daemonize -c $PREFIX -o $LOG_FILE -p $PID_FILE -l $LOCK_FILE $DAEMON && \ - echo "ok" || echo "failed" -} - -stop () { - echo -n "Stopping $NAME: " - if [[ -s "$PID_FILE" ]]; then - PID=$(head -n1 $PID_FILE) - kill $PID 2> /dev/null && echo "ok" || echo "not running?" - fi - rm -f -- $PID_FILE $LOCK_FILE -} - -status () { - if [[ -s "$PID_FILE" ]]; then - PID=$(head -n1 $PID_FILE) - kill -0 $PID 2> /dev/null && echo "$NAME is running (pid: $PID)" || \ - echo "$NAME is not running" - else - echo "$NAME is not running" - fi -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - status) - status - ;; - *) - echo "usage: $0 {start|stop|restart|status}" - exit $E_USAGE - ;; -esac - -exit $?