QUESTION Script for to modify Hylafax infos

l4cky

Member
Joined
Jan 27, 2015
Messages
175
Reaction score
4
I have many installs of incrediblefax and I would like to write .sh script that can help me to run it instead of editing all over the configuration of each modems.

A script that can modify hyla.conf and config.ttyIAX0 to config.ttyIAX3

1) There are 2 hyla.conf and config.ttyIAXs located in /etc/hylafax and /var/spool/etc/hylafax
Which directory is to be chosen to modify? (or it has to be both)?

2) hyla.conf

I would like to modify the lines to:

Code:
JobFmt:   "%-5j %1a %15o %30M %-15.15e %5P %5D %5i %7z %.25s"
RcvFmt: "%7o %-10t %-25s %-20f %5p %1z %-40e"
PageSize: na-let
VRes: 196

3) config.ttyIAX0 to config.ttyIAX3

LinesDEFAULT VALUESTO MODIFY
CountryCode1Add # in front of the line
Area codecustomizedAdd # in front of the line
FAXNumber+1.800.555.1212xxx-xxx-xxx
LocalIdentifier"IncredibleFax""IncFax Mod"
TagLineFormat"From %%l|%c|Page %%P of %%T""DE %%l < %%n >|%Y-%m-%d %l:%M %p|Page %%P de %%T"


---------------------------------------------------------------------------------------------------------

I can think of using for example
echo "
#CountryCode
FAXNumber: xxx-xxx-xxxx
"
etc..

But echo means write and doesn't replace the line..

Maybe to use sed -i ? what will be the syntax?
 
To automated script this change, go to incrediblefax2020-raspi.sh and DELETE EVERYTHING BETWEEN line ~275 [# BUT remember, this must run AFTER faxsetup command so it will have to be a second loop!!!] AND line [# AvantFAX has some directives that we want to modify, pagesize and email address]  replace by:
echo "
JobReqNoAnswer: 180
JobReqNoCarrier: 180
#ModemRate: 14400
" >> /var/spool/hylafax/etc/config.ttyIAX0
sed -i "s/CountryCode/#CountryCode/" /var/spool/hylafax/etc/config.ttyIAX0
sed -i "s/AreaCode/#AreaCode/" /var/spool/hylafax/etc/config.ttyIAX0
sed -i "s/+1.800.555.1212/514-888-8888/g" /var/spool/hylafax/etc/config.ttyIAX0
sed -i "s/IAXmodem/WS/g" /var/spool/hylafax/etc/config.ttyIAX0
sed -i "s/From %%l|%c|Page %%P of %%T/DE %%l < %%n >|%Y-%m-%d %l:%M %p|Page %%P de %%T/g" /var/spool/hylafax/etc/config.ttyIAX0
sed -i "s/0600/0777/g" /var/spool/hylafax/etc/config.ttyIAX0
echo "
JobReqNoAnswer: 180
JobReqNoCarrier: 180
#ModemRate: 14400
" >> /var/spool/hylafax/etc/config.ttyIAX1
sed -i "s/CountryCode/#CountryCode/" /var/spool/hylafax/etc/config.ttyIAX1
sed -i "s/AreaCode/#AreaCode/" /var/spool/hylafax/etc/config.ttyIAX1
sed -i "s/+1.800.555.1212/514-888-8888/g" /var/spool/hylafax/etc/config.ttyIAX1
sed -i "s/IAXmodem/WS/g" /var/spool/hylafax/etc/config.ttyIAX1
sed -i "s/From %%l|%c|Page %%P of %%T/DE %%l < %%n >|%Y-%m-%d %l:%M %p|Page %%P de %%T/g" /var/spool/hylafax/etc/config.ttyIAX1
sed -i "s/0600/0777/g" /var/spool/hylafax/etc/config.ttyIAX1
echo "
JobReqNoAnswer: 180
JobReqNoCarrier: 180
#ModemRate: 14400
" >> /var/spool/hylafax/etc/config.ttyIAX2
sed -i "s/CountryCode/#CountryCode/" /var/spool/hylafax/etc/config.ttyIAX2
sed -i "s/AreaCode/#AreaCode/" /var/spool/hylafax/etc/config.ttyIAX2
sed -i "s/+1.800.555.1212/514-888-8888/g" /var/spool/hylafax/etc/config.ttyIAX2
sed -i "s/IAXmodem/WS/g" /var/spool/hylafax/etc/config.ttyIAX2
sed -i "s/From %%l|%c|Page %%P of %%T/DE %%l < %%n >|%Y-%m-%d %l:%M %p|Page %%P de %%T/g" /var/spool/hylafax/etc/config.ttyIAX2
sed -i "s/0600/0777/g" /var/spool/hylafax/etc/config.ttyIAX2
echo "
JobReqNoAnswer: 180
JobReqNoCarrier: 180
#ModemRate: 14400
" >> /var/spool/hylafax/etc/config.ttyIAX3
sed -i "s/CountryCode/#CountryCode/" /var/spool/hylafax/etc/config.ttyIAX3
sed -i "s/AreaCode/#AreaCode/" /var/spool/hylafax/etc/config.ttyIAX3
sed -i "s/+1.800.555.1212/514-588-8888/g" /var/spool/hylafax/etc/config.ttyIAX3
sed -i "s/IAXmodem/WS/g" /var/spool/hylafax/etc/config.ttyIAX3
sed -i "s/From %%l|%c|Page %%P of %%T/DE %%l < %%n >|%Y-%m-%d %l:%M %p|Page %%P de %%T/g" /var/spool/hylafax/etc/config.ttyIAX3
sed -i "s/0600/0777/g" /var/spool/hylafax/etc/config.ttyIAX3

# About hyla.conf
#delete line 53 jobfmt
sed -i "53d" /var/spool/hylafax/etc/hyla.conf
#add the lines
echo "
JobFmt: "%-5j %1a %15o %30M %-15.15e %5P %5D %5i %7z %.25s"
RcvFmt: "%7o %-10t %-25s %-20f %5p %1z %-40e"
PageSize: na-let
VRes: 196
" >> /var/spool/hylafax/etc/hyla.conf

# changing the font of lutRS18.pcf
mv /var/spool/hylafax/etc/lutRS18.pcf /var/spool/hylafax/etc/lutRS18.2pcf
wget -P /var/spool/hylafax/etc/ "https://xxx.com/other files/pbx/lutRS18.pcf"

for reference; replace WS, 888-8888, and xxx.com
 

Members online

Forum statistics

Threads
26,687
Messages
174,410
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top