On Sun, 11 Apr 2021 14:53:51 +1000, faeychild wrote:
This is something I do very infrequently and usually incorrectly.
I hear that. I do my three nodes and my neighbor.
So I am asking if anyone has a foolproof method
Not necessarily Foolproof, but works the majority of time.
Do I run the Brother driver install script first and then install from
MCC.
I choose to install stuff which Brother does not install first, then
run brother install script.
I am guessing that with the Brother drivers installed, MCC will
operate much better, - if it's needed.
Offhand I do not understand that statement.
The Brother scrip hunts for a package manager and uses first
one found, I have to disable several prior to install. Managers are
_pkg_mgrs="/usr/bin/dpkg /usr/bin/dnf /usr/bin/yum"
on my system that I disable.
The printer is MFC-9040CDW and it is networked
Would have helped if you provided the brother support page for
your printer. Going to assume W means scanner.
If you want to automate the install, you will need the expect rpm.
Want expect examples install expect-examples rpm.
My script is made to undue the brother install, then do the install
again due to updates of Brother rpms. I have a pull_brother script
to tell me when there is a brother installer or brother rpm(s) update.
Basically script does the following:
ping_check to verify printer is up
remove_printer install rpms/links/files....
install the linux-brprinter-installer
disable_enable_pkg_mgrs -d to disable all package managers except rpm
install_scanner to install gimp, *xsane and whatnot
run_expect /local/bin/install_hll2380dw.exp to run brother script
/local/bin/brother_rule_changes
systemctl enable saned.socket
disable_enable_pkg_mgrs -e to enable all package managers
and use xmessage to pop up cups instructions to complete the install.
For the following it helps to have a complete hot backup partition
where you can put back the system to a pre-install state to start again.
To get get list of what to uninstall, I run aide -init to get a system
baseline of all files on system.
Use "autoexpect linux-brprinter-installer HL-L2380DW"
to generate the expect script.
Use the cups admin screen to pick/setup the printer.
Then run aide -check, to get a list of all files changed on the
system to figure out what I need to remove prior to doing the install.
I read the *.exp to get list of rpms needing removal when uninstalling
When you run "autoexpect some_script_here" it generates a .exp
with all the output and your input. I then use it to create a new
..exp script to remove as much as I can so the script always runs
even if the verbiage changes. For example end user agreements and
rpm versions could change. Here is my printer expect file. ------8<------8<------8<--cut below this line----8<------8<------8< #!/usr/bin/expect -f
#
# This Expect script was generated by autoexpect on Thu Jun 11 03:38:57 2020
# Expect and autoexpect were both written by Don Libes, NIST.
#
# Note that autoexpect does not guarantee a working script. It
# necessarily has to guess about certain things. Two reasons a script
# might fail are:
#
# 1) timing - A surprising number of programs (rn, ksh, zsh, telnet,
# etc.) and devices discard or ignore keystrokes that arrive "too
# quickly" after prompts. If you find your new script hanging up at
# one spot, try adding a short sleep just before the previous send.
# Setting "force_conservative" to 1 (see below) makes Expect do this
# automatically - pausing briefly before sending each character. This
# pacifies every program I know of. The -c flag makes the script do
# this in the first place. The -C flag allows you to define a
# character to toggle this mode off and on.
set force_conservative 1 ;# set to 1 to force conservative mode even if
;# script wasn't run conservatively originally
if {$force_conservative} {
set send_slow {1 .1}
proc send {ignore arg} {
sleep .1
exp_send -s -- $arg
}
}
#
# 2) differing output - Some programs produce different output each time
# they run. The "date" command is an obvious example. Another is
# ftp, if it produces throughput statistics at the end of a file
# transfer. If this causes a problem, delete these patterns or replace
# them with wildcards. An alternative is to use the -p flag (for
# "prompt") which makes Expect only look for the last line of output
# (i.e., the prompt). The -P flag allows you to define a character to
# toggle this mode off and on.
#
# Read the man page for more info.
#
# -Don
set timeout 35
spawn bash linux-brprinter-installer HL-L2380DW
match_max 100000
expect {
-re "Test Print" {
send -- "n\r"
exp_continue
}
-re "destination Device URI." {
send -- "I\r"
exp_continue
}
-re "enter IP address" {
send -- "192.168.11.190\r"
exp_continue
}
-re "y/N" {
send -- "y\r"
exp_continue
}
-re "Y/n" {
send -- "y\r"
exp_continue
}
-re "OK?" {
send -- "y\r"
exp_continue
}
}
expect eof
--- MBSE BBS v1.0.7.21 (GNU/Linux-x86_64)
* Origin: A noiseless patient Spider (2:250/1@fidonet)