1. Bicom Systems
  2. Solution home
  3. SERVERware
  4. HOWTOs SERVERware 5

SCRIPTS :: Using internal scripts guide

THIS DOCUMENT SHOULD PROVIDE A GUIDE ON HOW TO USE SOME OF OUR INTERNAL SCRIPTS



UPGRADE PRECHECK SCRIPT


This script was created to automate pre-upgrade checks so that important steps will not be missed during manual checks.


First, the location of the script can be found HERE


Once you have downloaded the script, you will need to start it, this script offers multiple arguments and usage can be found below,


sh precheck.sh check 6.3



Above will initiate a pre-check, which will provide you with all the needed information before you can schedule an upgrade with the customer/partner.


check - initiates check function

6.3 - tells the script from which link to download upgrade scripts


As we can see below,


if [[ $action = 'check' ]]
  then
  precheck

function precheck()

#Download and execute upgrade scripts
  echo "${blue}Downloading upgrade scripts...${reset}"
        cd /opt/
        wget https://downloads.bicomsystems.com/updates-$VER/upgrade/upgrade.tar.gz


Above are just parts of the script that only show why are these 2 relevant when executing the script


Please note that 6.3 as the versions evolve will be variable, so once 6.4 is available you would be using 6.4, etc.


An additional argument that is available is,


sh precheck.sh tools


This argument will initiate the download of additional scripts, these include tool.sh script and backup-cdr.tar.gz ( which contains CDR archiving script ).


The first script named tool.sh will contain 2 functions that enable the user to automatically install Polycom firmware and g729 codec, to use tool.sh please check below,


sh precheck.sh tools


This will download tool.sh script then we can start using it,


sh tool.sh g729

sh tool.sh firmware


The first line will invoke function to install g729 which will ask you for the PBXware version, so it contains both version 5 and 6 installations. 


The second line will invoker function to install Polycom firmware, and automatically clean up archived files so they do not take up space and also a folder in which these are extracted to.


NOTE: The Polycom installation script contains a link to the Polycom firmware pack, which has all Polycom firmware files which are required on the latest version by all Polycom models supported on PBXware.


CDR ARCHIVING SCRIPT

In the case of VPS, you will have to log in through the host and start SCREEN on the host.


This is in case you lose connection during the process, so you can re-attach back to the SCREEN session.


Usage below,


wget downloads.bicomsystems.com/backup-cdr/backup-cdr.tar.gz

cd /opt/

tar xvf backup-cdr.tar.gz

cd backup-cdr

To run the script do the following,

sh backup-cdr-4x.sh 1 year (6 month/15day)

#Above example archives ALL CDRs older than 1 year

for version 5.x and 6.x,

sh backup-cdr-5x.sh 6 month

#Above example archives ALL CDRs older than 6 months

PLEASE MAKE SURE YOU RUN THE PROPER SCRIPT FOR THE SYSTEM YOU ARE ON.

The script needs 2 parameters to be given:
A positive number
“day”, “year” or “month”



Archived files will be saved in folder,


/opt/pbxware/pw/var/log/cdr_dump/