F
F
fokin_nikolay19892019-01-25 09:19:25
bash
fokin_nikolay1989, 2019-01-25 09:19:25

How can I write a bash script?

I am writing a script to check if the certificate is installed or not

#!/bin/bash
echo "++++++++++++++ Установка списков отозванных сертификатов ++++++++++++++"
   vguc=$(/opt/cprocsp/bin/*/certmgr -inst -crl -store root -file vguc2.crl | egrep ErrorCode)
        if [ "$(vgus)" -eq "[ErrorCode: 0x00000000]" ]; then
        echo "СЕРТИФИКАТ УСТАНОВЛЕН"
        else
  echo "СЕРТИФИКАТ НЕ УСТАНОВЛЕН"
        fi

If done like this
/opt/cprocsp/bin/*/certmgr -inst -crl -store root -file vguc2.crl | egrep ErrorCode

then at the output [ErrorCode: 0x00000000]
but writes that it does not match, I do not understand what is wrong

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Taran, 2019-01-25
@shambler81

Sense to check on the text if the completion code is erroneous?
In general, in the task it would not be bad to show the output

Q
q2zoff, 2019-01-25
@q27off

-eq is an operator for comparing numbers. Use == to compare strings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question