committing changes in /etc made by "-bash"

Package changes:
This commit is contained in:
2022-06-28 13:58:41 +03:00
parent 8d7d57094b
commit d88901024c
6 changed files with 28 additions and 29 deletions

View File

@@ -1,16 +1,14 @@
#!/bin/bash
#!/bin/sh
# We're passed the version of the kernel being removed
inst_kern=$1
if [ -x /usr/sbin/dkms ]; then
while read line; do
name=`echo "$line" | awk '{print $1}' | sed 's/,$//' | cut -d'/' -f1`
vers=`echo "$line" | awk '{print $1}' | sed 's/,$//' | cut -d'/' -f2`
arch=`echo "$line" | awk '{print $3}' | sed 's/:$//'`
echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2
dkms remove -m $name -v $vers -k $inst_kern -a $arch
done < <(dkms status -k $inst_kern 2>/dev/null | grep ": installed")
if command -v dkms > /dev/null; then
dkms status -k "$inst_kern" 2>/dev/null | while IFS=",:/ " read -r name vers _ arch status; do
[ "$status" = "installed" ] || continue
echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2
dkms remove -m "$name" -v "$vers" -k "$inst_kern" -a "$arch"
done
fi
rmdir --ignore-fail-on-non-empty \