better check if program exists

This commit is contained in:
Jonathan Baecker 2020-09-14 17:26:59 +02:00
parent f2c985c51f
commit f9fec88aab

View File

@ -41,7 +41,7 @@ runInstall() {
fi fi
fi fi
if [[ "$(which ffmpeg 2>&1)" == *"which"* ]]; then if ! ffmpeg -version &> /dev/null; then
echo "" echo ""
echo "------------------------------------------------------------------------------" echo "------------------------------------------------------------------------------"
echo "compile and install (nonfree) ffmpeg:" echo "compile and install (nonfree) ffmpeg:"
@ -61,7 +61,7 @@ runInstall() {
done done
fi fi
if [[ "$(which nginx 2>&1)" == *"which"* ]]; then if ! nginx -t &> /dev/null; then
echo "" echo ""
echo "------------------------------------------------------------------------------" echo "------------------------------------------------------------------------------"
echo "install and setup nginx:" echo "install and setup nginx:"
@ -577,14 +577,14 @@ EOF
ln -s "$mediaPath" /var/www/ffplayout-frontend/static/ ln -s "$mediaPath" /var/www/ffplayout-frontend/static/
sudo -H -u $serviceUser bash -c 'npm install' npm install
cat <<EOF > ".env" cat <<EOF > ".env"
BASE_URL='http://$domainFrontend' BASE_URL='http://$domainFrontend'
API_URL='/' API_URL='/'
EOF EOF
sudo -H -u $serviceUser bash -c 'npm run build' npm run build
chown $serviceUser. -R /var/www chown $serviceUser. -R /var/www