src/zlevis-mkinitfs.in: update
Added check functionality, to check if zlevis is installed into mkinitfs and if the features are active.
This commit is contained in:
parent
6e769464cf
commit
ca5daa5453
1 changed files with 23 additions and 1 deletions
|
|
@ -24,7 +24,7 @@ fi
|
||||||
# Function to display usage information of zlevis-mkinitfs
|
# Function to display usage information of zlevis-mkinitfs
|
||||||
info() {
|
info() {
|
||||||
exec >&2
|
exec >&2
|
||||||
echo "Usage: \"zlevis-mkinitfs {install|uninstall}\""
|
echo "Usage: \"zlevis-mkinitfs {install|uninstall|check}\""
|
||||||
exit 2
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -95,9 +95,31 @@ uninstall() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to check if zlevis is installed in mkinitfs
|
||||||
|
check() {
|
||||||
|
if grep -q "zlevis" "${loc_mkinitfs}/initramfs-init"; then
|
||||||
|
if [ -f "${loc_mkinitfs}/initramfs-init.bak" ]; then
|
||||||
|
echo "[+] zlevis is installed in mkinitfs with zlevis-mkinitfs"
|
||||||
|
else
|
||||||
|
echo "[+] zlevis is installed in mkinitfs without zlevis-mkinitfs"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "[-] zlevis is not installed into mkinitfs"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -q "^features=.*zlevis" "$loc_conf"; then
|
||||||
|
echo "[+] zlevis is present in features"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "[-] zlevis is not present in features"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Determine the argument path and execute the relevant function
|
# Determine the argument path and execute the relevant function
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"install") install;;
|
"install") install;;
|
||||||
"uninstall") uninstall;;
|
"uninstall") uninstall;;
|
||||||
|
"check") check;;
|
||||||
*) info;;
|
*) info;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue