| #!/bin/sh |
| |
| # Copyright 2002-2004 The Apache Software Foundation |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| ################################################### |
| # Convenience script for running 'overseer' for use |
| # by the webapp |
| ################################################### |
| |
| . `dirname $0`/local-vars |
| |
| NAMEDPIPE=$WEBAPP/WEB-INF/commands |
| |
| if [ ! -p "$NAMEDPIPE" -a -e "$NAMEDPIPE" ]; then |
| echo "----------------------------------" |
| echo "ERROR: The file:" |
| echo " $NAMEDPIPE" |
| echo "exists and is not a named pipe. Please delete it and try again" |
| echo "----------------------------------" |
| exit |
| fi |
| [ ! -e "$NAMEDPIPE" ] && mkfifo $NAMEDPIPE |
| |
| OVERSEER_LOG=overseer.log |
| |
| echo "-------------------------------------" |
| echo "Forrestbot 'overseer' server launched" |
| echo "" |
| echo "Instructions:" |
| echo " 1) Type the ssh passphrase" |
| echo " 2) ctrl-z this parent process" |
| echo " 3) Type 'bg'" |
| echo "------------------------------------" |
| |
| nohup ssh-agent bash -c "ssh-add > /dev/null && exec nohup ./overseer < $NAMEDPIPE > $OVERSEER_LOG" |