Skip to content

Commit

Permalink
Add pkg check for uninstall mode
Browse files Browse the repository at this point in the history
- Added pkg check for uninstall mode
  • Loading branch information
tmiland committed Aug 25, 2024
1 parent ce4420e commit cbfdcd5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kernel_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,12 @@ install_kernel() {
chk_permissions
# Uninstall kernel
if [ "$mode" = "uninstall" ]; then
apt remove linux-{image,headers}-"${LINUX_VER}"
if dpkg -s linux-headers-"${LINUX_VER}" >/dev/null 2>&1; then
apt purge linux-headers-"${LINUX_VER}"
exit
elif dpkg -s linux-image-"${LINUX_VER}" >/dev/null 2>&1; then
apt purge linux-image-"${LINUX_VER}"
fi
exit
fi

Expand Down

0 comments on commit cbfdcd5

Please sign in to comment.