Commit 92a048ea authored by Sophie Brun's avatar Sophie Brun

Replace .init with .service file

parent c3a0910b
#!/bin/sh
### BEGIN INIT INFO
# Provides: beef-xss
# Required-Start: $network $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: BeEF
# Description: Browser Exploitation Framework
### END INIT INFO
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Browser Exploitation Framework" # Introduce a short description here
NAME=beef-xss # Introduce the short server's name here
DAEMON=/usr/share/beef-xss/beef # Introduce the server's location here
DAEMON_ARGS="" # Arguments to run the daemon with
SCRIPTNAME=/etc/init.d/$NAME
#PIDFILE=/usr/lib/dradis/server/tmp/pids/server.pid
# Exit if the package is not installed
[ -x $DAEMON ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
#
# Function that starts the daemon/service
#
do_start()
{
export LANG=C.UTF-8
start-stop-daemon --start \
--user beef-xss \
--chuid beef-xss \
--chdir /usr/share/beef-xss \
--startas "$DAEMON" \
--background \
-- $DAEMON_ARGS
}
#
# Function that stops the daemon/service
#
do_stop()
{
start-stop-daemon --stop \
--user beef-xss \
--retry 2
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
start-stop-daemon --status --user beef-xss && exit 0 || exit $?
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
exit 3
;;
esac
:
[Unit]
Description=beef-xss
After=network.target
[Service]
Type=simple
User=beef-xss
ExecStart=/usr/share/beef-xss/beef
[Install]
WantedBy=multi-user.target
......@@ -44,7 +44,6 @@ Vcs-Git: git://git.kali.org/packages/beef-xss.git
Package: beef-xss
Architecture: all
Depends: adduser,
lsb-base,
ruby | ruby-interpreter,
ruby-ansi,
ruby-dataobjects,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment