pika-kernel-manager/data/scripts/get_kernel_pika.sh

19 lines
825 B
Bash
Raw Normal View History

2024-08-31 08:46:24 +03:00
#! /bin/bash
2025-01-04 20:41:17 +03:00
if [[ "$1" == "list" ]]
2024-09-01 10:10:07 +03:00
then
apt list 2>&1 | cut -f1 -d'/' | grep -v dbg | grep -E "linux-image-.*-pikaos" | cut -f3- -d"-" | tr -d ' '
2025-01-04 20:41:17 +03:00
elif [[ "$1" == "current_version" ]]
then
dpkg -s kernel-pika 2>&1 | grep -v "does not have a stable" | grep Depends: | head -n1 | cut -f2 -d":" | cut -f1 -d"," | cut -f3 -d"-" | tr -d ' '
elif [[ "$1" == "current_pkgname" ]]
then
dpkg -s kernel-pika 2>&1 | grep Depends: | tr "," "\n" | cut -f2 -d":" | grep linux-image | tr -d ' '
elif [[ "$1" == "version" ]]
then
apt show kernel-pika 2>&1 | grep -v "does not have a stable" | grep Depends: | head -n1 | cut -f2 -d":" | cut -f1 -d"," | cut -f3 -d"-" | tr -d ' '
elif [[ "$1" == "pkgname" ]]
then
2024-09-01 10:10:07 +03:00
apt show kernel-pika 2>&1 | grep Depends: | tr "," "\n" | cut -f2 -d":" | grep linux-image | tr -d ' '
2025-01-04 20:41:17 +03:00
fi