From: server Date: Tue, 21 Jan 2025 18:53:32 +0000 (-0500) Subject: Tue Jan 21 01:53:32 PM EST 2025 X-Git-Url: http://www.foleosoft.com/?a=commitdiff_plain;h=6de81885b03ca8d20e7cd46dd01231c37ebc18d5;p=CryptoFoleo.git Tue Jan 21 01:53:32 PM EST 2025 --- diff --git a/build.sh b/build.sh index 7168f8f..2af4920 100755 --- a/build.sh +++ b/build.sh @@ -14,10 +14,33 @@ then set -x -e sudo cp bin/CryptoFoleo.h /usr/local/include/ sudo cp bin/libCryptoFoleo.so /usr/local/lib/ + set +e + cat /etc/profile | grep LD_LIBRARY_PATH | grep usr/local/lib + err=$? + set -e + if [ $err -eq 1 ] + then + cat /etc/profile > .tmp + echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' >> .tmp + mv .tmp /etc/profile + fi elif [ "$1" == "uninstall" ] then set -x -e sudo rm /usr/local/include/CryptoFoleo.h /usr/local/lib/libCryptoFoleo.so + set +e + cat /etc/profile | grep 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' + err=$? + set -e + if [ $err -eq 0 ] + then + read -p "Do you want to remove /usr/local/lib from /etc/profile? (y/n): " y + if [ "$y" = "y" ] || [ "$y" = "Y" ] + then + cat /etc/profile | grep -v 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' > .tmp + mv .tmp /etc/profile + fi + fi else set -x -e gcc -shared -fPIC src/all.c -o bin/libCryptoFoleo.so -lgmp -DDEVICE='"/dev/random"'