Re: ADCH++
Posted: 26 Feb 2009, 08:35
Thank you nice to have someone to test with now to start messing with python and making a start up script
Empowering and innovating features for the peer to peer masses
https://forum.dcbase.org/
Code: Select all
#!/bin/bash
# adchppd install script version 1.0
# This file is made for ADCH++ (http://adchpp.sf.net/)
# Install script made by Toast (http://www.adcportal.com)
# This will start retrieving tools necessary for getting the source
# Before running this script make sure to edit your adchpp.xml to your needs its located in adchpp/etc/
echo installation starting...
echo retriving Launchpad Bazaar Tool and Python
sudo apt-get install bzr python
bzr branch lp:adchpp
cd adchpp
echo "This will compile the source, getting nessary compilers for making ADCH++"
sudo apt-get install gcc scons swig
echo Edit the line to scons to "scons mode=release" if you want a release build instead of debug build
scons
echo now the script will start to copy the files to its correct place
sudo cp -rf etc build/debug-default/bin/etc
sudo cp -rf plugins/Script/examples build/debug-default/bin/Scripts
sudo apt-get install lua5.1 liblua5.1-0
sudo mkdir -p /usr/local/lib/lua/5.1
sudo cp build/debug-default/bin/luadchpp.so /usr/local/lib/lua/5.1/
export LUA_PATH='/home/toast/adchpp/build/debug-default/bin/Scripts/?.lua'
echo "Install script done"
Code: Select all
#!/bin/bash
# adchppd install script version 1.0
# This file is made for ADCH++ (http://adchpp.sf.net/)
# Install script made by Toast (http://www.adcportal.com)
# This will start retrieving tools necessary for getting the source
# Before running this script make sure to edit your adchpp.xml to your needs its located in adchpp/etc/
# Usage: sh adchpp_install_script.sh
echo installation starting...
echo retriving Launchpad Bazaar Tool and Python
sudo apt-get install bzr python
bzr branch lp:adchpp
cd adchpp
echo "This will compile the source, getting nessary compilers for making ADCH++"
sudo apt-get install gcc scons swig
echo Edit the line to scons to "scons mode=release" if you want a release build instead of debug build
scons
echo now the script will start to copy the files to its correct place
sudo cp -rf /build/debug-default/bin /usr/bin/adchpp
sudo cp -rf etc /etc/adchpp
sudo apt-get install lua5.1 liblua5.1-0
sudo mkdir -p /usr/local/lib/lua/5.1/
sudo mkdir -p /usr/local/share/lua/5.1/
sudo cp -rf plugins/Script/examples /usr/local/share/lua/5.1/
sudo cp /usr/bin/adchpp/luadchpp.so /usr/local/lib/lua/5.1/
export LUA_PATH='/usr/local/share/lua/5.1/?.lua'
echo "Install script done"
no problem i'm glad i can help u r doing a great job with install script! Soon we'll have totally automated install and run scripts and maybe pack it ?Toast wrote:Thank you nice to have someone to test with now to start messing with python and making a start up script
Code: Select all
#!/bin/sh
# Crontab script for ADCH++
#
# To know how to install the crontab, read the INSTALL file.
###############################################################
# CONFIGURATION
###############################################################
# ADCH++ binary directory
ADCPATH=/home/yapi/adchpp/build/debug-default/bin
# Name of the pid file
ADCPIDF=adchpp.pid
# Name of the executable
ADCPROG=adchppd
# Parameters to pass to the executable
ADCARGS="-d -p"
###############################################################
# DON'T EDIT ANYTHING BELOW #
###############################################################
PATH=/bin:/usr/bin:/usr/local/bin
ADCPID=
cd $ADCPATH
if [ -f $ADCPIDF ]
then
ADCPID=`cat $ADCPIDF`
if [ `ps auwx | grep $ADCPROG | grep $ADCPID | grep -v -c grep` = 1 ]
then
exit
fi
rm -f $ADCPIDF
fi
./$ADCPROG $ADCARGS $ADCPIDF
Code: Select all
#!/bin/bash
#
# adchppd startup script version 1.0
#
# This file is made for ADCH++ (http://adchpp.sf.net/)
# Specify config for adchppd.
. /etc/adchpp
# This part checks if network is up if its not it stops the startup script
# note: this might not work on every distribution so rem this comment if it causes problems
[[ ${NETWORKING} = "no" ]] && exit 0
stop (){
#This will kill any running adchppd so we dont get any erorrs.
echo "Checking so there isnt any current running adchppd processes."
for oldpid in `ps -A | grep adchppd | cut -c 0-6`; do
kill -9 $oldpid
if [[ $1 == "-v" ]]
then
echo $oldpid
fi
done
rm -f /var/run/adchppd.pid
}
start (){
#This will start the process.
if [[ $1 == "-v" ]]
then
echo "Starting adchppd process"
fi
servcount=`expr 0`
for cfile in `ls /etc/adchpp`; do
echo -n $cfile
echo -n " -> "
grep adchppd /etc/adchpp/$cfile
# This line will execute adchppd
#sudo -u nobody /usr/bin/adchppd /etc/adchpp/$cfile > /dev/null &
/usr/bin/adchppd /etc/adchpp/$cfile > /dev/null &
let servcount=servcount+1
done
#Create the pid file...
ps -A | grep adchppd | cut -c 0-6 > /var/run/adchppd.pid
#Creating pid file is done!
echo "adchppd is running now."
}
case "$1" in
start)
if [[ ! -e /var/run/adchppd.pid ]]
then
start $2
if [[ -e /var/run/adchppd.pid ]]
then
echo "Startup [SUCCESS]"
fi
else
if [[ $2 == "-v" ]]
then
echo "adchppd is already running checking pids..:"
#Checks before displaying pid file.
if [[ -e /var/run/adchppd.pid ]]
then
cat /var/run/adchppd.pid
fi
echo "Please kill any old adchppd processes."
else
echo "adchppd is already running please kill any old processes."
fi
echo "Startup [FAILED]"
fi
;;
restart)
stop $2
if [[ $2 == "-v" ]]
then
echo "Waiting for old adchppd processes to die.."
fi
sleep 4
start $2
if [[ -e /var/run/adchppd.pid ]]
then
echo "Startup [SUCCESS]"
fi
;;
stop)
if [[ -e /var/run/adchppd.pid ]];
then
stop $2
echo "adchppd shutdown [SUCCESS]"
else
echo "Couldnt find any adchppd processes trying to kill anyways.."
stop $2
fi
;;
*)
echo "Usage: adchppd (start|stop|restart) [-v]"
Code: Select all
#!/bin/bash
# adchppd install script version 1.0a
# This file is made for ADCH++ (http://adchpp.sf.net/)
# Install script made by Toast (http://www.adcportal.com)
# This will start retrieving tools necessary for getting the source
# Before running this script make sure to edit your adchpp.xml to your needs its located in adchpp/etc/
# Usage: sh adchpp_install_script.sh
if [ `id -u` = 0 ]; then
echo installation starting...
echo retriving Launchpad Bazaar Tool and Python
apt-get install bzr python
bzr branch lp:adchpp
cd adchpp
echo "This will compile the source, getting nessary compilers for making ADCH++"
apt-get install gcc scons swig
echo Edit the line to scons to "scons mode=release" if you want a release build instead of debug build
scons
echo now the script will start to copy the files to its correct place
cp -rf /build/debug-default/bin/ /usr/bin/adchpp/
cp -rf etc /etc/adchpp
apt-get install lua5.1 liblua5.1-0
mkdir -p /usr/local/lib/lua/5.1/
mkdir -p /usr/local/share/lua/5.1/
cp -rf plugins/Script/examples /usr/local/share/lua/5.1/
cp /usr/bin/adchpp/luadchpp.so /usr/local/lib/lua/5.1/
export LUA_PATH='/usr/local/share/lua/5.1/?.lua'
echo "Install script done"
else
echo please run as root
fi
Code: Select all
#!/bin/bash
# adchppd install script version 1.0
# This file is made for ADCH++ (http://adchpp.sf.net/)
# Install script made by Toast (http://www.adcportal.com)
# This will start retrieving tools necessary for getting the source
# Before running this script make sure to edit your adchpp.xml to your needs its located in adchpp/etc/
# Usage: sh adchpp_install_script.sh
if [ `id -u` != 0 ]; then
echo please run as root
exit
fi
echo installation starting...
echo retriving Launchpad Bazaar Tool and Python
apt-get install bzr python
bzr branch lp:adchpp
cd adchpp
echo "This will compile the source, getting nessary compilers for making ADCH++"
apt-get install gcc scons swig
echo Edit the line to scons to "scons mode=release" if you want a release build instead of debug build
scons
echo now the script will start to copy the files to its correct place
cp -rf /build/debug-default/bin/ /usr/bin/adchpp/
cp -rf etc /etc/adchpp
apt-get install lua5.1 liblua5.1-0
mkdir -p /usr/local/lib/lua/5.1/
mkdir -p /usr/local/share/lua/5.1/
cp -rf plugins/Script/examples /usr/local/share/lua/5.1/
cp /usr/bin/adchpp/luadchpp.so /usr/local/lib/lua/5.1/
export LUA_PATH='/usr/local/share/lua/5.1/?.lua'
echo "Install script done"
Code: Select all
mkdir -p /usr/local/lib/lua/5.1/
mkdir -p /usr/local/share/lua/5.1/
cp -rf plugins/Script/examples /usr/local/share/lua/5.1/
cp /usr/bin/adchpp/luadchpp.so /usr/local/lib/lua/5.1/