#!/bin/sh # $Id: # # Copyright (C) 2008 Digium, Inc. # All rights reserved. # # rc.asterisk-gui: Update the AsteriskGUI with the baseline AsteriskGUI plus optional AsteriskGUI overlay files # # chkconfig: 2345 89 60 # description: AsteriskGUI daemon. # processname: asterisk-gui # pidfile: /var/run/asterisk-gui.pid # Installation directory AST_GUI_BASE=/var/lib/asterisk # Source function library. . /etc/rc.d/init.d/functions start() { if ! [ -x ${AST_GUI_BASE} ]; then echo "ERROR: ${AST_GUI_BASE} not found" exit 1 fi for i in static-http scripts; do rm -rf ${AST_GUI_BASE}/$i/ if [ -x ${AST_GUI_BASE}/gui/$i ]; then echo "Updating AsteriskGUI $i" cp -R ${AST_GUI_BASE}/gui/$i ${AST_GUI_BASE}/$i fi if [ -x ${AST_GUI_BASE}/gui-overlay -a -x ${AST_GUI_BASE}/gui-overlay/$i ]; then echo "Overlaying AsteriskGUI $i" cp -R ${AST_GUI_BASE}/gui-overlay/$i ${AST_GUI_BASE}/ fi done return 0 } stop() { echo return 0 } restart() { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) restart ;; *) echo "Usage: rc.asterisk-gui {start|stop|restart}" exit 1 esac exit $?