403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.89
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/databases/leofs/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/databases/leofs/files/leofs.in
#!/bin/sh

# PROVIDE: leofs
# REQUIRE: LOGIN cleanvar
# KEYWORD: shutdown
#
# /etc/rc.conf variables:
#
# leofs_enable (bool):	Set it to "YES" to enable swift.
# 			Default is "NO".
# leofs_servers (list):	Specify servers to run as a space separated
# 			list of possible values:
# 				gateway,
# 				manager,
# 				manager_slave,
#				storage.
#			The aliase ALL may be used to run all servers.
# 			Also the list can be overriden in command line:
#			any arguments but the first (if there are) are
#			treated as the server list.
#			Default is "ALL".
# leofs_user (string):	Set it to a user name the servers are run as.
# 			Default is "%%LEOFS_USER%%".

. /etc/rc.subr

name=leofs
rcvar=leofs_enable

load_rc_config $name

: ${leofs_enable:="NO"}
: ${leofs_servers:="ALL"}
: ${leofs_user=%%LEOFS_USER%%}

extra_commands="status"
restart_cdm=leofs_restart
start_cmd=leofs_start
status_cmd=leofs_status
stop_cmd=leofs_stop

leofs_restart()
{
    leofs_stop
    leofs_start
}

leofs_start()
{
    local status=0
    local s

    for s in ${leofs_servers}; do
	echo -n "Starting leofs ${s}... "
	%%PREFIX%%/sbin/leofs ${s} start
	if [ $? = 0 ]; then
	    echo "done."
	else
	    status=1
	fi
    done

    return $status
}

leofs_stop()
{
    local status=0

    for s in ${leofs_servers}; do
	echo -n "Stopping leofs ${s}... "
	%%PREFIX%%/sbin/leofs ${s} stop
	if [ $? = 0 ]; then
	    echo "done."
	else
	    status=1
	fi
    done

    return $status
}

leofs_status()
{
    local status=0

    for s in ${leofs_servers}; do
	%%PREFIX%%/sbin/leofs ${s} ping > /dev/null 2>&1
	if [ $? != 0 ]; then
	    echo "leofs ${s} is not running."
	    status=1
	else
	    echo "leofs ${s} is running."
	fi
    done

    return $status
}

cmd=$1 ; shift

if [ $# -gt 0 ]; then
    leofs_servers="$@"
fi

for s in ${leofs_servers}; do
    case "${s}" in
	ALL)
	    leofs_servers="manager manager_slave storage gateway"
	    break
	    ;;
	gateway|manager|manager_slave|storage)
	    ;;
	*)
	    warn "unknown leofs server: ${s}"
	    exit 1
	    ;;
    esac
done

for s in ${leofs_servers}; do
    required_files=%%LEOFS_ETCDIR%%/leo_${s}.conf
done

run_rc_command "$cmd"

Youez - 2016 - github.com/yon3zu
LinuXploit