correct quoting

This commit is contained in:
buanet
2023-02-20 11:58:08 +01:00
parent a17e0e4026
commit 6f83191969
4 changed files with 76 additions and 76 deletions

View File

@@ -1,20 +1,20 @@
#!/bin/bash
if [ $1 == "-install" ]
if [ "$1" == "-install" ]
then
apt-get -qq update
packages=$(cat /opt/scripts/.docker_config/.packages)
for i in $packages; do
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ];
if [ "$(dpkg-query -W -f='${Status}' "$i" 2>/dev/null | grep -c "ok installed")" -eq 0 ];
then
echo "$i is not installed. Installing..."
sudo apt-get -qq -y install $i
sudo apt-get -qq -y install "$i"
echo "Done."
else
echo "$i is already installed."
fi
done
elif [ $1 == "-update" ]
elif [ "$1" == "-update" ]
then
apt-get -qq update
apt-get -qq -y upgrade