Skip to content

Commit 97f46ca

Browse files
committed
Remove unneeded PDF printer commands
A delay (before WSL restarts) is all that is needed for lpadmin to work. While the next restart in the script isn't until after the OpenVnmrJ install, a 30 sec delay is added to ensure the PDF printer gets configured.
1 parent 7a99115 commit 97f46ca

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Install_OpenVnmrJ_WSL.ps1

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -726,14 +726,12 @@ function setupUbuntu([string]$distribution) {
726726
wsl --shutdown
727727
wsl -d $distribution /bin/bash -lic "echo ' '"
728728
wsl -d $distribution -u root sed -i 's/^Out.*/Out \$\{HOME\}\/PDF/' /etc/cups/cups-pdf.conf
729+
# Need a delay after lpadmin to get /etc/cups/printers.conf to be written from outside a WSL window
729730
if ((echo $pkgMan | Select-String apt)) {
730-
wsl -d $distribution -u root /bin/bash -lic "lpadmin -p cups-pdf -v cups-pdf:/ -E -P /usr/share/ppd/cups-pdf/CUPS-PDF_opt.ppd"
731+
wsl -d $distribution -u root /bin/bash -lic "lpadmin -p cups-pdf -v cups-pdf:/ -E -P /usr/share/ppd/cups-pdf/CUPS-PDF_opt.ppd; sleep 30"
731732
} else {
732-
wsl -d $distribution -u root /bin/bash -lic "lpadmin -p cups-pdf -v cups-pdf:/ -E -P /usr/share/cups/model/CUPS-PDF_opt.ppd"
733+
wsl -d $distribution -u root /bin/bash -lic "lpadmin -p cups-pdf -v cups-pdf:/ -E -P /usr/share/cups/model/CUPS-PDF_opt.ppd; sleep 30"
733734
}
734-
wsl -d $distribution -u root /bin/bash -lic "cupsaccept cups-pdf;cupsenable cups-pdf"
735-
# Need to enable/disable/enable with delays to get /etc/cups/printers.conf to be written from outside a WSL window
736-
wsl -d $distribution -u root /bin/bash -lic "sleep 10;cupsdisable cups-pdf;cupsenable cups-pdf;sleep 10"
737735
echo ""
738736
}
739737

0 commit comments

Comments
 (0)