73 lines
1.3 KiB
Bash
Executable file
73 lines
1.3 KiB
Bash
Executable file
#!/bin/sh
|
|
# Top-level cron scripts. Add this to (for example) /etc/cron.daily
|
|
|
|
err(){
|
|
testname=$1
|
|
errcode=$2
|
|
echo "Error in [$testname]"
|
|
logger "CLIXON: Error in [$testname]"
|
|
exit $errcode
|
|
}
|
|
|
|
# cd to working dir
|
|
cd /var/tmp
|
|
if [ $# -ne 0 ]; then
|
|
err "usage: $0" 0
|
|
fi
|
|
rm -rf cligen
|
|
rm -rf clixon
|
|
git clone https://github.com/olofhagsand/cligen.git
|
|
if [ $? -ne 0 ]; then
|
|
err "git clone cligen" 1
|
|
fi
|
|
cd cligen
|
|
CFLAGS=-Werror ./configure
|
|
if [ $? -ne 0 ]; then
|
|
err "configure" 2
|
|
fi
|
|
make
|
|
if [ $? -ne 0 ]; then
|
|
err "make" 3
|
|
fi
|
|
cd ..
|
|
git clone https://github.com/clicon/clixon.git
|
|
if [ $? -ne 0 ]; then
|
|
err "git clone clixon" 1
|
|
fi
|
|
cd clixon
|
|
CFLAGS=-Werror ./configure --with-cligen=../cligen
|
|
if [ $? -ne 0 ]; then
|
|
err "configure" 2
|
|
fi
|
|
make
|
|
if [ $? -ne 0 ]; then
|
|
err "make" 3
|
|
fi
|
|
sudo make install
|
|
if [ $? -ne 0 ]; then
|
|
err "make install" 4
|
|
fi
|
|
sudo make install-include
|
|
if [ $? -ne 0 ]; then
|
|
err "make install include" 5
|
|
exit 1
|
|
fi
|
|
cd example
|
|
make
|
|
if [ $? -ne 0 ]; then
|
|
err "make example" 6
|
|
fi
|
|
sudo make install
|
|
if [ $? -ne 0 ]; then
|
|
err "make install example" 7
|
|
fi
|
|
cd ../test
|
|
#./all.sh
|
|
(cd /home/olof/src/clixon/test; ./all.sh)
|
|
errcode=$?
|
|
if [ $errcode -ne 0 ]; then
|
|
err "test" $errcode
|
|
fi
|
|
cd ../..
|
|
rm -rf clixon cligen
|
|
logger "CLIXON: tests OK"
|