Pages

Thursday, December 10, 2009

SmartCard Reader and UBuntu CCam



Umpisahan NA!!!

http://www.circuitsarchive.org/index.php/SmartCard_PC_Serial_Reader_/_Writer_(Phoenix)


http://www.austech.info/programmers/14510-phoenix-nds3.html

Automated Installation script ( Installation.sh )

#!/bin/sh
#Automated Installation script
#Purpose: Installing CCcam on a bare Ubuntu system.
#Written by: CC_Boyet
#for info and contact use:
#http://Boyet.COM
#
#
##
#Requirements: Ubuntu
# Installation package
#
#Setting installation variables
PACKNAME=cccam_install_package.tar #Name of the installation package
EMUDIR=/emu #name of the initial emulation and script directory
TEMPDIR=/tmp/ccinst #temporary download and unpack dir

clear
echo "Installation script for automated CCcam installation"
echo "Complete with the latest cccamPHP webinfo from BOYET05"
echo ""
echo "Scripting written by CC_Boyet"
echo ""
echo "In case of any problems or support, visit http://FILSAT.COM"
sleep 5
mkdir $TEMPDIR
echo "Starting download of installation script"
wget http://h1.ripway.com/ccshare/$PACKNAME --output-document=$TEMPDIR/$PACKNAME > /dev/null 2>&1

if [ ! -f $TEMPDIR/$PACKNAME ] ; then
echo "## WARNING !! !! !! ##"
echo "Download of the installation package seems to have failed"
echo "Please check you're network settings and make sure the server is connected to the internet"

else
echo "Download successfull"
sleep 5
echo "Creating folders (if needed)"
if [ ! -e $EMUDIR ]
then
mkdir $EMUDIR
fi
if [ ! -e $EMUDIR/cccam ]
then
mkdir $EMUDIR/cccam
fi
if [ ! -e $EMUDIR/log ]
then
mkdir $EMUDIR/log
fi
if [ ! -e $EMUDIR/script ]
then
mkdir $EMUDIR/script
fi
if [ ! -e /var/etc ]
then
mkdir -p /var/etc
fi

echo "Unpacking installation files"
tar -xzf $TEMPDIR/$PACKNAME -C $TEMPDIR
echo "Moving script files to their right directory"
mv -f $TEMPDIR/*.sh $EMUDIR/script
chmod 755 $EMUDIR/script/*.sh

VER=$(exec uname -r|grep amd64)
if [ "$VER" = "" ]
then VER="i386"
else VER="AMD64"
fi
if [ "$VER" = "i386" ]
then
mv $TEMPDIR/CCcam.x86 $EMUDIR/cccam
chmod 755 $EMUDIR/cccam/CCcam.x86
else
mv $TEMPDIR/CCcam.x86_64 $EMUDIR/cccam
chmod 755 $EMUDIR/cccam/CCcam.x86_64
fi

echo "00 3 * * * root $EMUDIR/script/./configupdate.sh >> $EMUDIR/log/configupdate.log 2>&1" >> /etc/crontab
echo "15,45 * * * * root $EMUDIR/script/./illegal.sh >> $EMUDIR/log/illegal.log 2>&1" >> /etc/crontab
echo "*/5 * * * * root $EMUDIR/script/./check.sh >>/emu/log/check.log 2>&1" >> /etc/crontab

$(exec ln $EMUDIR/script/cccam.sh /bin/cccam)

echo "/bin/cccam start &" > /etc/rc.local
echo "/emu/script/runonce.sh &" >>/etc/rc.local
echo "exit 0" >>/etc/rc.local

echo "Downloading and installing various needed programs like apache, ftp, ssh..."
echo "This is needed for the webinfo tool to work"
echo "This might take some time to download and install (depending on computer and network speeds)"
apt-get -qq update > /dev/null 2>&1
apt-get -qq install apache2 -qy > /dev/null 2>&1
apt-get -qq install php5 -qy > /dev/null 2>&1
apt-get -qq install ssh -qy > /dev/null 2>&1
apt-get -qq install vsftpd -qy > /dev/null 2>&1

mv -f $TEMPDIR/vsftpd.conf /etc/vsftpd.conf
cp -rf $TEMPDIR/phpinfo/* /var/www/
rm -f /var/www/index.html

echo "02 * * * * root wget -O - http://127.0.0.1/cron_update.php?p=1 >/dev/null 2>&1" >> /etc/crontab
echo "30 * * * * root wget -O - http://127.0.0.1/cron_ping.php?p=1 >/dev/null 2>&1" >> /etc/crontab

clear
echo "The server will need a static IP adress instead of the dynamic one used during installation"
echo "You will be prompted to enter the new IP adress, subnet mask, gateway and DNS now."
echo ""
echo "What is the IP adress reserved for the new server?"
read IP
echo "What is the subnet mask of the sever?"
read SUB
echo "What is the gateway? (usually this is you're router/modem)"
read GATE
echo "$IP" >> $TEMPDIR/iptemp
CAST=$(grep -o '[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}' $TEMPDIR/iptemp)
#
echo "# The loopback network interface" > /etc/network/interfaces
echo "auto lo" >> /etc/network/interfaces
echo "iface lo inet loopback" >> /etc/network/interfaces
echo "" >> /etc/network/interfaces
echo "# The primary network interface" >> /etc/network/interfaces
echo "allow-hotplug eth0" >> /etc/network/interfaces
echo "auto eth0" >> /etc/network/interfaces
echo "iface eth0 inet static" >> /etc/network/interfaces
echo "address $IP" >> /etc/network/interfaces
echo "netmask $SUB" >> /etc/network/interfaces
echo "broadcast $CAST.255" >> /etc/network/interfaces
echo "gateway $GATE" >> /etc/network/interfaces
#
echo "What is the IP adress of the DNS server"
echo "(This can be the IP of you're router/modem or the DNS from you're provider"
read DNS
echo "nameserver $DNS" > /etc/resolv.conf

clear
pidof vsftpd > $TEMPDIR/vsftpd.pid
FTP=$(exec cat $TEMPDIR/vsftpd.pid)
kill -9 $FTP
sleep 2
/usr/sbin/vsftpd & > /dev/null 2>&1
rm -r $TEMPDIR
/sbin/ifdown eth0
sleep 2
/sbin/ifup eth0
echo "################# Congratulations #################"
echo "You're server is ready to run."
echo "All you need to do now is upload the config file, then reboot the machine"
echo "Remember!! The server is allready active and reachable now with it's NEW IP adress"
fi
exit

No comments: