Uploaded image for project: 'SignServer'
  1. SignServer
  2. DSS-1955

Use 'command' instead of 'which' in the scripts

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1.0.CR1, 5.1.0.Final
    • Component/s: CLI, Client CLI
    • Labels:
      None
    • Environment:
      Docker container jboss/wildfly. signserver-ce-5.0.0.Beta1-bin.zip
    • Sprint:
      SignServer-Sprint 103

      Description

      Hello,

      I found two issues with bin/signserver, and I'm guessing it also appears in the other scripts:

      1. 'which' is deprecated; please use 'command -v, as in

      14: JAVACMD=`command -v java`

      2. There's no point in setting JAVACMD until it is determined JAVA_HOME is not set.  I recommend lines 14-16 be:

      14: # Check that JAVA_HOME is set

      15: if [ ! -n "$JAVA_HOME" ]; then

      16:     JAVACMD=`which java`

      17:     if [ ! -n "$JAVACMD" ]

      The environment in which I'm working, the jboss/wildfly docker container, has no 'which' command, so either of the would address it.  Why not fix both?

      Thank you.

        Attachments

          Activity

            People

            Assignee:
            marcus.lundblad@primekey.se Marcus Lundblad
            Reporter:
            wayn3w Wayne Wylupski
            Verified by:
            Markus Kilås
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour Original Estimate - 1 hour
                1h
                Remaining:
                Time Spent - 33 minutes Remaining Estimate - 30 minutes
                30m
                Logged:
                Time Spent - 33 minutes Remaining Estimate - 30 minutes
                33m