dpkgs -s instead of dpkg -l

This commit is contained in:
julien
2025-10-03 15:33:10 +02:00
parent b1f8257e31
commit 7011d22394
4 changed files with 5 additions and 5 deletions

View File

@@ -4,7 +4,8 @@ echo
echo " => Docker"
echo
if [ ! -f /usr/bin/docker ]; then
dpkg -s docker > /dev/null 2>&1
if [ $? -ne 0 ]; then
# Add Docker's official GPG key
mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg --yes
@@ -20,4 +21,3 @@ if [ ! -f /usr/bin/docker ]; then
# Install packages
apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
fi

View File

@@ -4,7 +4,7 @@ echo
echo " => Firewall"
echo
dpkg -l ufw > /dev/null 2>&1
dpkg -s ufw > /dev/null 2>&1
if [ $? -ne 0 ]; then
apt-get install ufw -y
ufw enable

View File

@@ -34,7 +34,7 @@ fi
for i in $pkglist
do
dpkg -l $i > /dev/null 2>&1
dpkg -s $i > /dev/null 2>&1
if [ $? -ne 0 ]; then
apt-get install $i -y
fi

View File

@@ -4,7 +4,7 @@ echo
echo " => ZRAM"
echo
dpkg -l zram-tools > /dev/null 2>&1
dpkg -s zram-tools > /dev/null 2>&1
if [ $? -ne 0 ]; then
apt-get install zram-tools -y
sed -i '/#ALGO=lz4/s/^#//g' /etc/default/zramswap