Answer the question
In order to leave comments, you need to log in
How to make a file run as root?
Good day,
I wrote a button to start updating certificates and encountered such a problem
Launch button
nano /usr/share/applications/certcopy.desktop
[Desktop Entry]
Version=1.0
Name=Обновление сертификатов
Exec=/etc/certupdate
Terminal=true
Type=Application
StartupNotify=true
#Categories=X-Red-Hat-Extra;Application;Development;
Categories=System;Security;Settings;
X-Desktop-File-Install-Version=0.15
Icon=/usr/local/eclipse/icon.xpm
#!/bin/bash
echo ================================================================================
echo " УСТАНОВКА КОРНЕВЫХ И СПИСКОВ ОТОЗВАННЫХ СЕРТИФИКАТОВ"
echo ================================================================================
cd /opt/cprocsp/bin/*/
rm *.crl* 2> /dev/null
rm *.cer* 2> /dev/null
cp -r /mnt//cer/* /opt/cprocsp/bin/*/
echo
if ; then
echo --------------------------------------------------------------------------------
echo -e " Корневой сертификат (2013) \e[1;32m[OK]\e[0m"
echo --------------------------------------------------------------------------------
./certmgr -inst -store root -file cacer.cer | grep "Not valid"
else
err=$(./certmgr -inst -store root -file cacer.cer | grep "Error")
echo --------------------------------------------------------------------------------
echo -e " Корневой сертификат (2013) \e[31m[ERROR]\e[0m"
echo --------------------------------------------------------------------------------
echo $err
fi
if ; then
echo --------------------------------------------------------------------------------
echo -e " Корневой сертификат (2015) \e[1;32m[OK]\e[0m"
echo --------------------------------------------------------------------------------
./certmgr -inst -store root -file cacernew_2015.cer | grep "Not valid"
else
err=$(./certmgr -inst -store root -file cacernew_2015.cer | grep "Error")
echo --------------------------------------------------------------------------------
echo -e " Корневой сертификат (2015) \e[31m[ERROR]\e[0m"
echo --------------------------------------------------------------------------------
echo $err
fi
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question