-
Notifications
You must be signed in to change notification settings - Fork 7
/
Install.sh
executable file
·61 lines (52 loc) · 1.45 KB
/
Install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
# Object: Installation Helper.
# Author: Fulup Ar Foll
# Copyright: what ever will make you happy
if test -d $AJGDIR/www; then
ROOTDIR=$AJGDIR/www
else
if test -d /opt/ajg-daemon; then
ROOTDIR=/opt/ajg-daemon/www
else
if test -d $HOME/.ajg; then
ROOTDIR=$HOME/.ajg/www
fi
fi
fi
CONFIG=$HOME/.ajg/default.conf
SESSIONDIR=$HOME/.ajg/sessions
echo "------------------------------------------"
echo "Install AJM files in $ROOTDIR"
mkdir -p $ROOTDIR
mkdir -p $SESSIONDIR
#update javasript binaries
echo "Updating JavaScript Minified versions"
(cd src; ./Make.sh)
if test ! -w $ROOTDIR; then
echo " Need root permission to write into $ROOTDIR"
sudo cp -r --update www/* $ROOTDIR
else
cp -r --update www/* $ROOTDIR
fi
ajg-daemon --version 2>/dev/null
if test $? -ne 0; then
echo WARNING: AlsaJsonGateway not found [must install ajg-daemon]
else
# save config and exit
ajg-daemon --saveonly --sessiondir=$SESSIONDIR --rootdir=$ROOTDIR --config=$CONFIG
AJGINSTALL=done
fi
echo "------------------------------------------"
echo "AJG/AJM: install"
echo " - ROOTDIR=$ROOTDIR"
echo " - SESSIONDIR=$SESSIONDIR"
echo ""
if test ! -z $AJGINSTALL; then
echo "Start ajg-daemon with:"
echo " ajg-daemon --verbose --config=$CONFIG"
echo " ajg-daemon --daemon --config=$CONFIG"
else
echo "WARNING: ajg-daemon missing"
echo " Download from https://github.com/fulup-bzh/AlsaJsonGateway"
fi
echo "------------------------------------------"