LINUX.ORG.RU

Сообщения tirex2k

 

bash перестановка символов в строке

Форум — General

Нельзя кодить в пятницу :) Всем спасибо. Вывод был такой

=============================================================================
1-------
Issuer              : OGRN=1234567890123, INN=001234567890, STREET=ул. Сущёвский вал д. 18, C=RU, S=г. Москва, L=Москва, O="ООО ""КРИПТО-ПРО""", CN="Тестовый УЦ ООО ""КРИПТО-ПРО"""
Subject             : CN=
Serial              : 0x7C00201863AC9C83FD13DC6B16000E00201863
SHA1 Hash           : 8c11eedcc4bbe81f713ae4994c76f5052125ded2
SubjKeyID           : 05ec70dfe5b86e1cc6e00a7583405505b705c8ab
Signature Algorithm : ГОСТ Р 34.11-2012/34.10-2012 256 бит
PublicKey Algorithm : ГОСТ Р 34.10-2012 (512 bits)
Not valid before    : 19/06/2025  09:49:43 UTC
Not valid after     : 19/08/2025  09:59:43 UTC
PrivateKey Link     : Yes
Container           : SCARD\rutoken_lt_3c517c26\0A00\1DA2
Provider Name       : Crypto-Pro GOST R 34.10-2012 KC1 CSP
Provider Info       : ProvType: 80, KeySpec: 1, Flags: 0x0
OCSP URL            : http://testgost2012.cryptopro.ru/ocsp2012g/ocsp.srf
OCSP URL            : http://testgost2012.cryptopro.ru/ocsp2012gst/ocsp.srf
CA cert URL         : http://testgost2012.cryptopro.ru/CertEnroll/testgost2012(14).crt
CA cert URL         : http://testgost2012.cryptopro.ru/CertEnroll/testroot.p7b
CDP                 : http://testgost2012.cryptopro.ru/CertEnroll/!0422!0435!0441!0442!043e!0432!044b!0439%20!0423!0426%20!041e!041e!041e%20!0022!041a!0420!0418!041f!0422!041e-!041f!0420!041e!0022(14).crl
CDP                 : http://testgost2012.cryptopro.ru/CertEnroll/testgost2012(14).crl
Extended Key Usage  : 1.3.6.1.5.5.7.3.2
                      1.3.6.1.4.1.311.10.3.12

Задача была получить дату Not valid after и сравнить с текущей. Остановился на коде

certmgr -list -store uMy | awk '/(after)/ {split($5, d, "/"); print d[3] d[2] d[1]}'
20250819

 

tirex2k
()

Bash список пользователей

Форум — General

Доброго дня, задача для каждого не системного пользователя выполнить ряд комманд. вывожу список пользователей исключая системных, так:

awk -F: '($3>=1000)&&($3<60000)&&($1!="nobody"){print $1}' /etc/passwd

На Bash есть такой скрипт, работает, но выводит всех:

IFS=':'
while read -r user _ _ _ _ _ _; do
#    [[ $user = "#"* || ! $user ]] && continue # skip comments, empty lines
    cp -a -p "/home/root.sto" "home/$user/stores"
    chown -R $user:$user "home/$user/stores"
    usermod -a -G test $user
done < /etc/passwd

не как не получается их скрестить.

 

tirex2k
()

RSS подписка на новые темы