#!/bin/bash # # ubuntu-irlp-install - v.0.2 Robert Pectol (kk7av) # http://rob.pectol.com/irlp/irlp-echolink-install-files/ubuntu-irlp-install # # This IRLP installer script was specifically written for Ubuntu Linux systems. # It will NOT work on other distributions! It was heavily modified from the # original irlp-install script found on the CentOS official IRLP release # distribution. # ##################################################################################### # Make sure we are ROOT! if [ "$UID" != "0" ]; then echo -e "\E[1;33mThis Ubuntu IRLP installer must be executed with root privileges! Exiting...\E[32;0m" exit 1 fi # Clear the screen for the install clear echo "" # Make sure this is an Ubuntu System OS_FILE_LOC="`ls /etc | grep release`" OS_INFO="`cat /etc/$OS_FILE_LOC`" IS_UBUNTU="`echo $OS_INFO | egrep 'Debian|Ubuntu'`" if [ "$IS_UBUNTU" == "" ]; then echo -e "\E[1;33mNon-Ubuntu system detected! This script CANNOT be run on a non-Ubuntu system! Exiting...\E[32;0m" exit 1 fi # Warn if not Ubuntu 6.06 IS_SUPPORTED="`echo $IS_UBUNTU | egrep '6.06|dapper'`" if [ "$IS_SUPPORTED" == "" ]; then echo -e "\E[1;33mYou are attempting to install IRLP on a version of Ubuntu that has not been thoroughly tested!\E[32;0m" echo "" echo "Install detected: $IS_UBUNTU" echo "" echo -e "\E[1;33mUbuntu 6.06 (Dapper) is the suggested version as it has been tested and is known to work well.\E[32;0m" echo -e "\E[1;33mProceed with the install anyway? (Y/n)\E[32;0m" read installanyway if [[ "$installanyway" == "n" || "$installanyway" == "N" ]]; then echo "Exiting..." exit 1 fi else echo "Ubuntu 6.06 (Dapper) detected! Continuing install..." sleep 2 fi clear # disclaimer, etc. echo "" echo "" echo "This script performs an install of the IRLP software. It is for" echo "NEW nodes only as it will generate a new PGP security keyfile." echo "If you already have a node number and a node backup file, use" echo "the IRLP re-installer script instead of this one." echo echo "* Please note - This is not considered an official install of IRLP" echo " since it deviates from the, "preferred" Linux Distribution as" echo " set forth by the IRLP designer/maintainers. For this reason," echo " you must not expect the maintainers to support it. Basically," echo " you are on your own with it! But don't worry, Ubuntu Linux is" echo " probably more secure and less prone to problems anyway. :-)" echo " That being said, this disclaimer must be considered and under-" echo " stood before proceeding. Furthermore, I accept absolutely NO" echo " responsibility for your use of this script. If the information" echo " contained herein is incorrect or interpreted incorrectly, and" echo " causes undesired results, I will NOT be held liable in ANY way" echo " whatsoever. In short, USE AT YOUR OWN RISK!" echo echo "To verify that you understand the above statements, please type" echo -n "ACCEPT (in all capitals) and press ENTER : " ; read accept_or_not echo if [ "$accept_or_not" != "ACCEPT" ] ; then echo "Please re-run this installer script and make sure you understand and" echo "comply with the disclaimer(s) before proceeding." exit 1 fi clear # Sets the install directory ID=/home/irlp # enable extra repos echo "enabling extra package repositories..." if [ ! -f /etc/apt/sources.list_orig ]; then cp /etc/apt/sources.list /etc/apt/sources.list_orig fi egrep -v 'deb cdrom|backports|deb file' /etc/apt/sources.list | egrep 'deb http|deb ftp|deb-src' | sed 's/#//g; s/^[ \t]*//;s/[ \t]*$//' > /tmp/sources.list mv -f /tmp/sources.list /etc/apt/sources.list # make sure the package database is up to date echo "refreshing packages database..." apt-get update # Set the IP of the download server (requires the use of ncftp so we make sure it's available first) echo "checking for ncftpget..." if ! (which ncftpget &>/dev/null) ; then echo "WARNING: Missing - ncftpget" echo "Installing ncftp utilities..." apt-get install ncftp fi if (which ncftpget &>/dev/null) ; then echo "ncftpget installed [ OK ]" else echo "[ FAIL ]" echo "ncftp could not be installed. You need to figure out why, or else" echo "install it manually (apt-get install ncftp) before trying to install" echo "IRLP with this script." echo echo "Script Terminated" exit 1 fi echo "detecting download server IP address..." ncftpget ftp://ftp.irlp.net/pub/install/irlp-install >&/dev/null 2>&1 SERVERIP=`cat ./irlp-install 2>/dev/null | egrep '^SERVERIP=' | cut -d '=' -f2` rm -f ./irlp-install >&/dev/null 2>&1 if [ "$SERVERIP" == "" ]; then SERVERIP=208.67.253.178 echo "Server IP could NOT be detected! Using default of: $SERVERIP" else echo "Server IP detected as: $SERVERIP" fi sleep 3 # set environment file variable ENVFILE=$ID/custom/environment echo "Proceeding to install NEW node..." sleep 3 clear echo "" echo " IRLP has a series of requirements that must be met before it can run successfully under" echo " Ubuntu Linux. These requirements will now be checked. If something is missing, an attempt" echo " to retrieve and install the missing item(s) will be performed. Also, any necessary changes" echo " to the default settings will also be applied and verified. The validation process requires" echo " that this box be connected to the Internet so that the proper packages can be retrieved and" echo " installed. If this box does not yet have a working Internet connection, you should abort" echo " this installer script now, and configure the box's Internet connection. This script can be" echo " safely re-run once the connection to the Internet has been configured. To abort now, press" echo " CTRL-C and the script will exit. Or..." echo "" echo "Press ENTER to continue." read echo "" echo "" ##### ##### check for sox ##### echo "checking for sox..." if ! (which sox &>/dev/null) ; then echo "WARNING: Missing - sox" echo "Installing sox audio utilities..." apt-get install sox fi if (which sox &>/dev/null) ; then echo "sox installed [ OK ]" else echo "[ FAIL ]" echo "sox could not be installed. You need to figure out why, or else" echo "install it manually (apt-get install sox) before trying to install" echo "IRLP with this script." echo echo "Script Terminated" exit 1 fi sleep 2 ##### ##### check for gawk ##### echo "checking for GNU-awk (gawk)..." if ! (which gawk &>/dev/null) ; then echo "WARNING: Missing - gawk" echo "Installing GNU-awk (gawk)..." apt-get install gawk fi if (which gawk &>/dev/null) ; then echo "gawk installed [ OK ]" else echo "[ FAIL ]" echo "gawk could not be installed. You need to figure out why, or else" echo "install it manually (apt-get install gawk) before trying to install" echo "IRLP with this script." echo echo "Script Terminated" exit 1 fi sleep 2 ##### ##### check for telnet ##### echo "checking for telnet client..." if ! (which telnet &>/dev/null) ; then echo "WARNING: Missing - telnet" echo "Installing telnet client..." apt-get install telnet fi if (which telnet &>/dev/null) ; then echo "telnet installed [ OK ]" else echo "[ FAIL ]" echo "telnet could NOT be installed. You need to figure out why, or else" echo "install it manually (apt-get install telnet) before trying to install" echo "IRLP with this script." echo echo "Script Terminated" exit 1 fi sleep 2 ##### ##### check for aumix ##### echo "checking for aumix..." if ! (which aumix &>/dev/null) ; then echo "WARNING: Missing - aumix" echo "Installing aumix curses-based mixer utility..." apt-get install aumix fi if (which aumix &>/dev/null) ; then echo "aumix installed [ OK ]" else echo "[ FAIL ]" echo "aumix could not be installed. You need to figure out why, or else" echo "install it manually (apt-get install aumix) before trying to install" echo "IRLP with this script." echo echo "Script Terminated" exit 1 fi sleep 2 ##### ##### check for usleep ##### echo "checking for usleep..." if ! (which usleep &>/dev/null) ; then echo "WARNING: Missing - usleep" echo "Installing usleep utility..." wget http://rob.pectol.com/irlp/irlp-echolink-install-files/usleep mv ./usleep /bin/usleep chmod 755 /bin/usleep fi if (which usleep &>/dev/null) ; then echo "usleep installed [ OK ]" else echo "[ FAIL ]" echo "usleep could not be installed. You need to figure out why, or else" echo "install it manually before trying to restore your node with this script." echo "Since Ubuntu does not have usleep in the official repos, you will need" echo "to grab it here: " echo "http://rob.pectol.com/irlp/irlp-echolink-install-files/usleep" echo echo "Once you have retrieved a copy of usleep, you will need to move it into your" echo "/bin directory and make it executable (chmod 755 /bin/usleep). After you've" echo "done this, re-run this IRLP install script." echo echo "Script Terminated" exit 1 fi sleep 2 ##### ##### check for configured sound device ##### echo "checking for configured sound device..." if ! (echo 1>/dev/audio >/dev/null 2>&1) && [ "$1" != "nosound" ] ; then echo "[ FAIL ]" echo "The script has detected that your sound card is not configured." echo "You must exit and fix this. I'm leaving it up to you to figure it out!" echo echo "If your sound card is working fine, and you still get this message, " echo "then run the install script with the argument, 'nosound' as in: " echo "./ubuntu-irlp-install nosound" echo echo -n "Press ENTER to exit."; read exit 1 else if [ "$1" = "nosound" ] ; then echo "Sound card detection skipped" else echo "sound device configured [ OK ]" fi fi sleep 2 ##### ##### check for wget ##### echo "checking for wget..." if ! (which wget &>/dev/null) ; then echo "WARNING: Missing - wget Internet Browser" echo "Installing wget..." apt-get install wget fi if (which wget &>/dev/null) ; then echo "wget installed [ OK ]" else echo "[ FAIL ]" echo "wget could not be installed. You need to figure out why, or else" echo "install it manually (apt-get install wget) before trying to install" echo "IRLP with this script." echo echo "Script Terminated" exit 1 fi sleep 2 ##### ##### check for lynx ##### echo "checking for lynx..." if ! (which lynx &>/dev/null) ; then echo "WARNING: Missing - lynx Internet Browser" echo "Installing lynx..." apt-get install lynx fi if (which lynx &>/dev/null) ; then echo "lynx installed [ OK ]" else echo "[ FAIL ]" echo "lynx could not be installed. You need to figure out why, or else" echo "install it manually (apt-get install lynx) before trying to install" echo "IRLP with this script." echo echo "Script Terminated" exit 1 fi sleep 2 ##### ##### check for sed ##### echo "checking for sed (stream editor)..." if ! (which sed &>/dev/null) ; then echo "WARNING: Missing - sed (stream editor)" echo "Installing sed..." apt-get install sed fi if (which sed &>/dev/null) ; then echo "sed installed [ OK ]" else echo "[ FAIL ]" echo "sed could not be installed. You need to figure out why, or else" echo "install it manually (apt-get install sed) before trying to install" echo "IRLP with this script." echo echo "Script Terminated" exit 1 fi sleep 2 ##### ##### check for pico/nano ##### echo "checking for pico text editor..." if ! (which pico &>/dev/null) ; then echo "WARNING: Missing - pico" echo "Installing nano (pico text editor clone)..." apt-get install nano fi if ! (which pico &>/dev/null) ; then ln -s `which nano` /usr/bin/pico fi if (which pico &>/dev/null) ; then echo "pico installed [ OK ]" else echo "[ FAIL ]" echo "pico could not be installed. You need to figure out why, or else" echo "install it manually (apt-get install nano) before trying to install" echo "IRLP with this script." echo echo "Script Terminated" exit 1 fi sleep 2 ##### ##### check for netcat ##### echo "checking for netcat..." if ! (which nc &>/dev/null) ; then echo "WARNING: Missing - netcat" echo "Installing netcat..." apt-get install netcat fi if (which nc &>/dev/null) ; then echo "netcat installed [ OK ]" if [ ! -e /usr/bin/nc ]; then echo "creating symlink..." ln -s `which nc` /usr/bin/nc > /dev/null 2>&1 if [ ! -e /usr/bin/nc ]; then echo "symlink NOT created!" else echo "symlink created [ OK ]" fi fi else echo "[ FAIL ]" echo "netcat could NOT be installed. You need to figure out why, or else" echo "install it manually (apt-get install netcat) before trying to install" echo "IRLP with this script." echo echo "Script Terminated" exit 1 fi # This cleans up the ugly BASHRC problem where root does not have # a pretty prompt. if [ ! -f /root/.bash_profile ] ; then if [ -f /etc/bashrc ]; then ln -s /etc/bashrc /root/.bash_profile fi fi # THIS CHECKS TO MAKE SURE YOUR HOSTNAME RESOLVES, # and ADDS A SIMPLE LINE TO THE HOSTS FILE IF NOT CONTINUE="NO" echo "checking to make sure hostname resolves..." while [ "$CONTINUE" = "NO" ] ; do if ! (ping -c1 `hostname` > /dev/null 2>&1) ; then echo "The script has detected that your hostname = " `hostname` " does not resolve." echo echo "This is required for the irlp-install to continue. " echo echo -n "Would you like the script to try to add a line to the hosts file to help? : (Y/n)" ; read YESNO if [ "$YESNO" = "y" ] || [ "$YESNO" = "Y" ] || [ "$YESNO" = "" ] ; then echo echo "Adding line : 127.0.0.1 " `hostname` " to /etc/hosts" echo "127.0.0.1 localhost.localdomain localhost "`hostname` >> /etc/hosts else echo echo "This line is required for IRLP to work." echo "If you are still having troubles please email installs@irlp.net" echo echo -n "Press ENTER to exit."; read exit 1 fi else CONTINUE="YES" echo "hostname resolves [ OK ]" echo echo fi done echo echo "All prerequisites look satisfied. Press ENTER to continue installing IRLP..." read clear echo "" echo "Your IRLP node really should have a Secure Shell Server if you plan on remotely" echo "administering it. Most nodes require this. Would you like to install this? (Y/n): " read install_openssh-server if [[ "$install_openssh-server" == "n" || "$install_openssh-server" == "N" ]]; then echo "Ok. NOT checking for/installing a Secure Shell Server..." else ##### ##### check for openssh-server ##### echo "checking for openssh-server..." if ! (which sshd &>/dev/null) ; then echo "WARNING: Missing - openssh-server" echo "Installing openssh-server..." apt-get install openssh-server else echo "Already installed!" fi if (which sshd &>/dev/null) ; then echo "openssh-server installed [ OK ]" echo "press enter to continue." read else echo "[ FAIL ]" echo "openssh-server could not be installed. You need to figure out why, or else" echo "install it manually (apt-get install openssh-server). This is NOT a critical" echo "error and will not harm the install. You may safely proceed with the IRLP" echo "install but if you want remote shell access to your node, openssh-server will" echo "need to be installed afterwards." echo echo "Press enter to continue." read fi sleep 2 fi #Here is where we determine the node owners name and callsign. This info will be included with #the pgp key file emailed to the IRLP server. This is how we can determine if the keyfile is #legitimite. CONTINUE="NO" while [ "$CONTINUE" = "NO" ] ; do echo "We must gather some information about you so we can confirm your original order" echo "information. This information is vital to the security of the system. This" echo "information will be verified by a human-being before being processed." echo "Submissions sent with incorrect information will be ignored." echo echo "Please enter all the information you can. It will greatly speed up the process" echo "of IRLP being able to confirm your security key." echo echo _______________________________________________________________________________ echo "Enter your node CALLSIGN (all lowercase)." echo -n "Node Callsign : " ; read CALL if [ ${#CALL} -lt 3 ] ; then echo "ERROR : That callsign is less than 4 characters" echo -n "Press Enter to start entering info again." ; read CONTINUE="NO" clear continue fi echo echo "Enter the CALLSIGN of the person who ordered the board (all lowercase)." echo "If someone else ordered the board for you, make sure you use THEIR callsign" echo -n "Order Callsign : " ; read PERSONAL_CALL if [ ${#PERSONAL_CALL} -lt 3 ] ; then echo "ERROR : That callsign is less than 4 characters" echo -n "Press Enter to start entering info again." ; read CONTINUE="NO" clear continue fi echo echo "Enter the name which appeared on the IRLP order form. If someone else ordered" echo "the board for you, make sure you enter THEIR name, and NOT yours." echo -n "Order Name : " ; read FULL_NAME echo echo "Enter the approximate date the board was ordered. (Example - March, 2002)" echo -n "Order Date : " ; read ORDER_DATE echo echo "Enter the email address for correspondance about this install." echo -n "Email Address : " ; read EMAIL_ADDR echo echo "Here is the data you entered." echo "*******************************************************************************" echo "Node Callsign = $CALL" echo "Callsign on Order Form = $PERSONAL_CALL" echo "Full Name on Order Form = $FULL_NAME" echo "Approx Date of Order = $ORDER_DATE" echo "Email Address = $EMAIL_ADDR" echo "*******************************************************************************" echo echo -n "Are you SURE this data is all correct? (Y/n) : " ; read YESNO if [ "$YESNO" = "y" ] || [ "$YESNO" = "Y" ] || [ "$YESNO" = "" ] ; then CONTINUE="YES" else echo CONTINUE="NO" clear fi done # System to find a node number automatically - Queries the server for a random node # number, based on the first digit. The lock is only available for 24 hours. # Only do this if the node hasn't already been issued a number. if ! [ -a /root/.node_num ]; then echo "requesting a new node number..." telnet "$SERVERIP" 12000 2>/dev/null | grep "-" STATION=`telnet "$SERVERIP" 12001 2>/dev/null | grep stn` #Checks to see if the stationID was generated correctly. if [ ${#STATION} -ne "7" ] ; then echo There was an error with your stationID. Please contact installs@irlp.net for assitance. exit 1 else echo $STATION > /root/.node_num fi fi echo echo "*** Setting up IRLP node with callsign $CALL and stationID $STATION ***" echo "If there is any problem with the install, you should be able to run irlp-install" echo "again if required. Press ENTER to continue, or CTRL-C to exit." read echo -n Adding repeater user ... sleep 1 groupadd repeater /usr/sbin/useradd -d /home/irlp -g repeater repeater >/dev/null 2>&1 echo " done." echo -n Adding repeater user to the sys and lp groups ... sleep 1 /usr/sbin/usermod -d /home/irlp -s /bin/bash -G sys,lp,adm,repeater repeater >/dev/null 2>&1 echo " done." echo -n "Changing permissions of sound card device files in /dev ..." sleep 1 chmod 660 /dev/mixer* /dev/dsp* /dev/audio* chown root.sys /dev/mixer* /dev/dsp* /dev/audio* echo " done." echo "adding parport device if it doesn't already exist..." sleep 1 if ! [ `cat /etc/modules | grep ppdev` ]; then echo "ppdev" >> /etc/modules modprobe ppdev fi echo " done." echo -n Making IRLP directory structure ... sleep 1 mkdir $ID >/dev/null 2>&1 mkdir $ID/local >/dev/null 2>&1 mkdir $ID/custom >/dev/null 2>&1 mkdir $ID/bin >/dev/null 2>&1 mkdir $ID/run >/dev/null 2>&1 mkdir $ID/audio >/dev/null 2>&1 mkdir $ID/scripts >/dev/null 2>&1 mkdir $ID/log >/dev/null 2>&1 touch $ID/log/messages >/dev/null 2>&1 mkdir $ID/.pgp >/dev/null 2>&1 mkdir $ID/irlp-install-files >/dev/null 2>&1 echo " done." echo -n Setting up PGP base directory information ... sleep 1 rm -f $ID/.pgp/* >/dev/null 2>&1 touch $ID/.pgp/pgpdoc1.txt touch $ID/.pgp/pgpdoc2.txt touch $ID/.pgp/secring.pgp touch $ID/.pgp/pubring.pgp touch $ID/.pgp/config.txt echo " done." # remove old files/keys, etc. rm -fr $ID/*.tgz > /dev/null 2>&1 rm -fr $ID/*.pgp > /dev/null 2>&1 echo Downloading IRLP software tarfiles into $ID/ ... # change to the new home directory cd $ID #Added Oct13,2002 - This fix to d/l all the files at once, so we #do not have to wait for broken DNS machines. echo "Downloading the files from the server" ncftpget $SERVERIP $ID /pub/irlpv2.0/Baseaudio.tgz\ /pub/irlpv2.0/Bin.tgz /pub/irlpv2.0/Custom.tgz\ /pub/irlpv2.0/Scripts.tgz /pub/irlpv2.0/pubring.pgp echo Uncompressing Install Images .... echo -n "DIRECTORIES : custom, " if [ -f $ID/Custom.tgz ] ; then tar -zxf $ID/Custom.tgz else echo echo File Custom.tgz is MISSING.... exiting exit 1 fi echo -n "bin, " if [ -f $ID/Bin.tgz ] ; then tar -zxf $ID/Bin.tgz else echo echo File Bin.tgz is MISSING.... exiting exit 1 fi echo -n "audio (IDs), " if [ -f $ID/Audio.tgz ] ; then tar -zxf $ID/Audio.tgz fi echo -n "audio (base), " if [ -f $ID/Baseaudio.tgz ] ; then tar -zxf $ID/Baseaudio.tgz else echo echo File Baseaudio.tgz MISSING.... exiting exit 1 fi echo "scripts, " if [ -f $ID/Scripts.tgz ] ; then tar -zxf $ID/Scripts.tgz else echo echo File Scripts.tgz is MISSING.... exiting exit 1 fi echo -n "pgp, " if [ -f $ID/pubring.pgp ] ; then cp -f $ID/pubring.pgp $ID/.pgp/pubring.pgp else echo echo File pubring.pgp is MISSING.... exiting exit 1 fi echo "done." echo -n "Cleaning up install files ..." mv -f $ID/*.tgz $ID/irlp-install-files echo " done." #### Links for aumixrc #### echo -n Creating symlinks for aumix audio mixer ... touch /etc/aumixrc ln -sf /etc/aumixrc /home/irlp/.aumixrc ln -sf /etc/aumixrc /root/.aumixrc echo " done." #### Add line to rc.local #### if ! (cat /etc/init.d/rc.local | grep rc.irlp > /dev/null 2>&1) ; then echo -n Adding start lines to rc.local ... echo "# THIS LINE ADDED FOR THE IRLP SYSTEM" >> /etc/init.d/rc.local echo $ID/custom/rc.irlp >> /etc/init.d/rc.local echo " done." fi #### Adding irlp to the INETD/XINETD services file #### if ! (cat /etc/services | grep irlp_update > /dev/null 2>&1) ; then echo -n "Changing the inetd services file for IRLP ..." echo "# Added by the IRLP autoinstaller" >> /etc/services echo "irlp 15425/tcp #added by irlp.install" >> /etc/services echo " done." fi # Set up PGP stuff CONTINUE="NO" while [ "$CONTINUE" = "NO" ] ; do clear echo "**** SETTING UP PGP KEY ****" echo HOME=$ID $ID/bin/pgp -kg -u $STATION rm -f $HOME/.pgp/*.asc $ID/bin/pgp -kxa $STATION $HOME/.pgp/"$STATION".asc $HOME/.pgp/pubring.pgp >/dev/null 2>&1 $ID/bin/pgp -kxa $STATION $HOME/.pgp/"$STATION"sec.asc $HOME/.pgp/secring.pgp >/dev/null 2>&1 #This checks the pgp key, and if incorrect, forces the system to regenerate a new one. if cat $HOME/.pgp/"$STATION".asc | grep pub | grep 512 | grep "$STATION" >/dev/null 2>&1 ; then echo PGP key checks out OK. PGP key generation complete CONTINUE=YES else echo PGP Key generation failed. Please try again. echo -n "Press Enter to continue. " ; read rm -f $HOME/.pgp/secring.* rm -f $HOME/.pgp/*.asc if [ -f $HOME/.pgp/pubring.bak ] ; then rm -f $HOME/.pgp/pubring.pgp mv $HOME/.pgp/pubring.bak $HOME/.pgp/pubring.pgp fi CONTINUE=NO fi done # Create the ENVIRONMENT file from the template ... echo -n "Making the $ID/custom/environment file from template ..." echo "# This file is the IRLP ENVIRONMENT file. It is designed to set a list of global varaibles" > $ID/custom/environment echo "# which are used by the software. Be careful when editing this file as a small" >> $ID/custom/environment echo "# error can make you node totally unusable. " >> $ID/custom/environment echo "" >> $ID/custom/environment echo "# Place the callsign of your node below. USE ONLY LOWERCASE LETTERS" >> $ID/custom/environment echo "export CALLSIGN=$CALL" >> $ID/custom/environment echo "" >> $ID/custom/environment echo "# Put the IRLP station ID of your node below. NOTE you must enter the correct stationid" >> $ID/custom/environment echo "# which is assigned to you. Any other ID will cause your node not to operate properly." >> $ID/custom/environment echo "# USE ONLY LOWERCASE LETTERS" >> $ID/custom/environment echo "export STATIONID=$STATION" >> $ID/custom/environment cat $ID/custom/environment.tmpl >> $ID/custom/environment rm -f $ID/custom/environment.tmpl echo " done." # PATCHES to the environment file from things we learned above! if [ "$PPPDETECT" = "YES" ] ; then sed "s-ADAPTER_NAME=eth0-ADAPTER_NAME=ppp0-" /home/irlp/custom/environment > /home/irlp/custom/environment.tmp mv -f /home/irlp/custom/environment.tmp /home/irlp/custom/environment fi echo "done!" # Runs an rsync to update the files on the node to what is currently # on the server, to make sure we are not too far behind in updates. echo "Updating files on the system to ensure they are current ..." chmod +x $ID/bin/rsync $ID/bin/rsync -Wazv --exclude=stn*.wav $SERVERIP::irlp $ID echo "done." #### Setting File Permissions #### echo -n Setting file permissions for IRLP files ... chmod 660 "$ID"/audio/* chmod 750 "$ID"/bin/* chmod 750 "$ID"/scripts/* chmod 750 "$ID"/custom/* chmod 750 "$ID" chown -R repeater.repeater "$ID"/* chown repeater.repeater "$ID" chmod 750 "$ID"/custom/rc.irlp chown root.root "$ID"/custom/rc.irlp chmod 750 "$ID"/custom/environment chown root.repeater "$ID"/custom/environment chown repeater.repeater "$ID"/.pgp chown -R repeater.repeater "$ID"/.pgp/* echo " done." echo -n Setting profile for user repeater ... echo ". $ID/custom/environment" >> $ID/.bash_profile echo ". $ID/.bashrc" >> $ID/.bash_profile cp /etc/skel/.bashrc $ID/.bashrc chown repeater.repeater $ID/.bash* chmod 755 $ID/.bash_profile echo " done." # modifies udev rules for audio device nodes if (grep 'GROUP=\"audio\"' /etc/udev/rules.d/40-permissions.rules | grep 'SUBSYSTEM==\"sound\"' >&/dev/null 2>&1) ; then cp /etc/udev/rules.d/40-permissions.rules /root/udev_permissions.rules.bak sed "s-SUBSYSTEM==\"sound\", GROUP=\"audio\"-SUBSYSTEM==\"sound\", GROUP=\"sys\"-" /etc/udev/rules.d/40-permissions.rules > /tmp/40-permissions.rules mv -f /tmp/40-permissions.rules /etc/udev/rules.d/40-permissions.rules echo "udev rule for sound devices has been modified. The old udev rules file was saved in: '/root/udev_permissions.rules.bak'" else echo "udev rule for sound devices has already been properly set." fi #THIS SCRIPT REMOVES KMOD from the cron.d folder. echo "removing KMOD from cron..." if [ -f /etc/cron.d/kmod ] ; then rm -f /etc/cron.d/kmod echo "KMOD removed from /etc/cron.d/" fi sleep 3 clear # NEW SYSTEM to use FTP to send the public key to the install server using # ncftpput and anonmous FTP echo >> /home/irlp/.pgp/$STATION.asc echo >> /home/irlp/.pgp/$STATION.asc echo "SUBJECT=Auto-submission for $STATION-$CALL" >> /home/irlp/.pgp/$STATION.asc echo "Submitted=$DATE" >> /home/irlp/.pgp/$STATION.asc echo "Approx ORDER Date=$ORDER_DATE" >> /home/irlp/.pgp/$STATION.asc echo "Ordered By=$FULL_NAME-$PERSONAL_CALL" >> /home/irlp/.pgp/$STATION.asc echo "Correspondance to=$EMAIL_ADDR" >> /home/irlp/.pgp/$STATION.asc echo "Uploading your PGP key for validation and entry into the keyserver..." /usr/bin/ncftpput $SERVERIP /pub/install/newkeys/ /home/irlp/.pgp/$STATION.asc echo SENT! echo echo echo "The Ubuntu IRLP install process is almost complete. You should soon receive" echo "an email from the installation crew once your PGP key has been validated and" echo "installed. This can take anywhere from 12-48 hours as validation is done by" echo "an actual human being! This is for the security of IRLP. Please be patient." echo echo "Pres ENTER to continue..." read echo "Finishing install..." sleep 1 cs=`grep 'export CALLSIGN' /home/irlp/custom/environment | cut -d '=' -f2 | sed 's/^[ \t]*//;s/[ \t]*$//'` nn=`grep 'export STATIONID' /home/irlp/custom/environment | cut -d '=' -f2 | sed 's/^[ \t]*//;s/[ \t]*$//'` os=`wget http://rob.pectol.com/irlp/machine_id.sh > /dev/null 2>&1 && sh ./machine_id.sh` ver=`grep 'ubuntu-irlp-install -' $0 | awk '{$1=$1;print}' | cut -d ' ' -f4` if [ "$os" == "" ]; then os=`uname -r` fi stats_url="http://rob.pectol.com/cgi-bin/dl_stats.cgi" stats_result=`wget -q --no-cache --ignore-length -O- \ --post-data="value1=$cs&value2=$nn&value3=ubuntu-irlp-install_v$ver&value4=install&value5=$os&value6=nolink" \ $stats_url 2>&1` clear echo "IRLP INSTALL COMPLETE!" echo echo "You can now perform the steps in the after installation document located at:" echo "http://www.irlp.net/new-install/ " echo "Again, your node won't be able to connect to any other nodes/reflectors except" echo "the echo-reflector (9990-9) until your PGP key has been validated and entered" echo "into the IRLP keyserver's keyring. If this does not happen within 48 hours," echo "you may want to contact the IRLP installs folks. But I wouldn't mention that" echo "you are running IRLP under Ubuntu! :-)" echo echo "CONGRATULATIONS on installing IRLP under Ubuntu Linux! Enjoy!" exit 0