source: ocsinventory-agent/trunk/fuentes/tools/macosx/scripts/deployment.sh @ 468

Last change on this file since 468 was 468, checked in by mabarracus, 4 years ago

Copyt trusty code

File size: 585 bytes
Line 
1#!/bin/bash
2
3FILE=$1
4TMPDIR=/tmp/ocsng
5
6if [ ! -e $FILE ]; then
7        echo "File: $FILE doesn't exist, exiting"
8        exit 1;
9fi
10
11if [ `whoami` != 'root' ]; then
12        echo 'You must be root [or sudo] to run this...'
13        exit 1;
14fi
15
16echo "Deploying file: $FILE"
17
18mkdir $TMPDIR
19tar -zxvf $FILE -C $TMPDIR/
20cd $TMPDIR
21sudo sh installer-darwin.sh
22cd ../
23rm -R -f $TMPDIR
24
25PID=`ps ax -e | grep OCSNG | grep -v grep | awk '{print $1}'`
26if [ "$PID" !=  "" ]; then
27        echo "Service launched under Pid: $PID"
28        echo "Done"
29        exit 0
30else
31        echo "Service failed to launch but was installed, check your logs"
32fi
Note: See TracBrowser for help on using the repository browser.