Differences
This shows you the differences between two versions of the page.
tech:linux:startup_script_for_shellinabox [2014/11/15 09:13] |
tech:linux:startup_script_for_shellinabox [2014/11/15 09:13] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Start up script for Shell in a Box ====== | ||
+ | This is running on Ubuntu 12.04 | ||
+ | <code bash> | ||
+ | #!/bin/sh | ||
+ | # Start/stop the shellinaboxd daemon. | ||
+ | # | ||
+ | ### BEGIN INIT INFO | ||
+ | # Provides: shellinaboxd | ||
+ | # Required-Start: $syslog $time | ||
+ | # Required-Stop: $syslog $time | ||
+ | # Default-Start: 2 3 4 5 | ||
+ | # Default-Stop: 0 1 6 | ||
+ | # Short-Description: Shell in web browser | ||
+ | # Description: Shell In A Box implements a web server that can export arbitrary | ||
+ | # command line tools to a web based terminal emulator. This emulator | ||
+ | # is accessible to any JavaScript and CSS enabled web browser and | ||
+ | # does not require any additional browser plugins | ||
+ | ### END INIT INFO | ||
+ | |||
+ | test -f /usr/local/bin/shellinaboxd || exit 0 | ||
+ | |||
+ | . /lib/lsb/init-functions | ||
+ | |||
+ | case "$1" in | ||
+ | start) log_daemon_msg "Starting web shell" "shellinaboxd" | ||
+ | /usr/local/bin/shellinaboxd -s /:LOGIN --localhost-only -t --background=/var/run/shellinaboxd.pid | ||
+ | log_end_msg $? | ||
+ | ;; | ||
+ | stop) log_daemon_msg "Stopping web shell" "shellinaboxd" | ||
+ | kill -9 $(cat /var/run/shellinaboxd.pid) >/dev/null 2>&1 | ||
+ | rm /var/run/shellinaboxd.pid | ||
+ | log_end_msg $? | ||
+ | ;; | ||
+ | restart) log_daemon_msg "Restarting web shell" "shellinaboxd" | ||
+ | kill -9 $(cat /var/run/shellinaboxd.pid) >/dev/null 2>&1 | ||
+ | rm /var/run/shellinaboxd.pid | ||
+ | /usr/local/bin/shellinaboxd -s /:LOGIN --localhost-only -t --background=/var/run/shellinaboxd.pid | ||
+ | log_end_msg $? | ||
+ | ;; | ||
+ | *) log_action_msg "Usage: /etc/init.d/shellinaboxd {start|stop|restart}" | ||
+ | exit 2 | ||
+ | ;; | ||
+ | esac | ||
+ | exit 0 | ||
+ | </code> | ||