diff --git a/src/snap-pac-uki.fish b/src/snap-pac-uki.fish index 4b497e4..eeda028 100755 --- a/src/snap-pac-uki.fish +++ b/src/snap-pac-uki.fish @@ -7,10 +7,8 @@ end function check_deps -d "checks if all dependencies are available" set -l dependencies \ - "efibootmgr" \ "jq" \ "rg" \ - "sbsign" \ "sed" \ "snapper" \ @@ -21,6 +19,18 @@ function check_deps -d "checks if all dependencies are available" error "missing depenency: $dep" end end + + which "efibootmgr" >/dev/null 2>/dev/null + if test $status != "0" -a $CFG_EFI = "yes" + set -g CFG_EFI "no" + echo "CFG_EFI overwriten to \"no\": 'efibootmgr' not available" + end + + which "sbsign" >/dev/null 2>/dev/null + if test $status != "0" -a $CFG_EFI = "yes" + set -g CFG_SECUREBOOT "no" + echo "CFG_SECUREBOOT overwriten to \"no\": 'sbsign' not available" + end end function find_tasks -d "finds out what the program needs to do" @@ -122,9 +132,9 @@ end function main # prepare for execution - check_deps source "/etc/snap-pac-uki/config.fish" config + check_deps switch $argv[1] case "snapshots"