• ×
    Information
    Windows update impacting certain printer icons and names. Microsoft is working on a solution.
    Click here to learn more
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
  • ×
    Information
    Windows update impacting certain printer icons and names. Microsoft is working on a solution.
    Click here to learn more
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
Guidelines
We have new content about Hotkey issue, Click here to check it out!
Check out our WINDOWS 11 Support Center info about: OPTIMIZATION, KNOWN ISSUES, FAQs, VIDEOS AND MORE.
HP Recommended

@itsmyname --

 

The problem is not in the code or IF statement.

The problem was in settings.ini that does not exist when I mount USB Key on /mnt/

 

It is necessary to mount usb key on /mnt/usbkey/

 

And all is running.

HP Recommended

@McAneyth -- The problem is not in the code or IF statement.

 

I disagree. The coding-error causes the execution of the code to STOP -- to not completely do what the code was written to do, but to issue a second error-message.

 

Compare to driving your automobile over a nail, and the nail gets embedded in your tire. Later, when the tire goes "flat", you cannot drive to your destination. The first problem (driving over the nail) causes the second problem (undriveable).  In your case, the syntax-error causes your issue.

 

First message:  Unary operator expected

Second message: Image write mode is disabled 

 

HP Recommended

@Itsmyname -- Ok

 

The problem was not in the code, but in the mounted point and settings.ini that initialise enableWriteMode = 1.

 

When I used /mnt/ the settings.ini does not loaded. File was not present and the variable :  $enableWriteMode was not initialisated. It produces the first message.

 

The code uses /mnt/usbkey/settings.ini and /mnt/usbkey/images/.

 

When I used /mnt/usbkey/, the correct path to mount init.sh. settings.ini is correctly loaded and $enableWriteMode was correct and produced no error, the installation is Ok.

† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.