Skip to content

Commit

Permalink
Introduce apt_install_wrapper function to run apt commands depending …
Browse files Browse the repository at this point in the history
…on the terminal (#90)
  • Loading branch information
igorpecovnik authored Sep 22, 2024
1 parent a613848 commit 6483fb8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/armbian-configng/config.ng.system.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
#!/bin/bash


module_options+=(
["apt_install_wrapper,author"]="igorpecovnik"
["apt_install_wrapper,ref_link"]=""
["apt_install_wrapper,feature"]="Install wrapper"
["apt_install_wrapper,desc"]="Install wrapper"
["apt_install_wrapper,example"]="apt_install_wrapper apt-get -y purge armbian-zsh"
["apt_install_wrapper,status"]="Active"
)
#
# @description Use TUI / GUI for apt install if exists
#
function apt_install_wrapper
{
if [ -t 0 ] ; then
debconf-apt-progress -- $@
else
# Terminal not defined - proceed without TUI
$@
fi


module_options+=(
["install_de,author"]="Igor Pecovnik"
["install_de,ref_link"]=""
Expand Down

0 comments on commit 6483fb8

Please sign in to comment.