#!/bin/sh # ------- # File: session-cmd-script # Description: session-cmd session script # Author: Luis Garcia Gisbert # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston MA 02110-1301 USA # -------- ######### changed by mariodebian ######## [ -e /etc/default/tcos-standalone ] && . /etc/default/tcos-standalone DISPLAY_HOST=$(python -c 'import os; import tcosmonitor.shared; print tcosmonitor.shared.parseIPAddress(os.environ["DISPLAY"])') if [ -z ${DISPLAY_HOST} ] && [ "${TCOS_STANDALONE_START}" != "1" ]; then exit 0 fi ################# end #################### LIB_FILE="/usr/lib/tcos/session-cmd-common.sh" [ -r "$LIB_FILE" ] || exit 1 . ${LIB_FILE} EXEC_SCRIPT="/usr/lib/tcos/session-cmd-exec" # kill before launching again killall -w faucet &>/dev/null sleep 2 UNIX_SOCKET="$(create_socket)" || exit 0 rm -f "${UNIX_SOCKET}.sock" "${UNIX_SOCKET}.pid" faucet "${UNIX_SOCKET}.sock" --unix --daemon --pidfile "${UNIX_SOCKET}.pid" --in xargs ${EXEC_SCRIPT} chmod 600 "${UNIX_SOCKET}.sock" "${UNIX_SOCKET}.pid" exit 0