diff --git a/support/functions/_misc b/support/functions/_misc index f2e54fa..fa2d948 100644 --- a/support/functions/_misc +++ b/support/functions/_misc @@ -10,7 +10,7 @@ _nl(){ printf "$rs_\n" } _set_dialog_types(){ - gui="$(which dialog)" + gui="$(type -pf dialog)" st_="--stdout" ib_="--infobox" ip_="--inputbox" @@ -104,14 +104,14 @@ e_addons(){ } sysinfo(){ printf "$g_l\nSYSTEM$w_l\n" - system_info=$(which lsb_release) + system_info=$(type -pf lsb_release) [ ${#system_info} -ge 11 ] && lsb_release -irc printf "Uptime:\t\t$(uptime -p)\n" printf "$g_l\nMEMORY$w_l\n" free -mht | awk '/Mem/{print "Memory:\t\tTotal: " $2 "Mb\tUsed: " $3 "Mb\tFree: " $4 "Mb"} /Swap/{print "Swap:\t\tTotal: " $2 "Mb\tUsed: " $3 "Mb\tFree: " $4 "Mb" }' [ -f /sys/dev/block ] && lsblk printf "$g_l\n CPU$w_l\n" - cpu_info=$(which lscpu) + cpu_info=$(type -pf lscpu) [ ${#cpu_info} -ge 5 ] && lscpu | grep -iE 'model name|vendor id|Architecture|per socket|MHz' printf "$g_l\nNetwork\n" printf "$w_l""Hostname:\t$HOSTNAME\n" diff --git a/support/functions/_plugin_update_toolchain b/support/functions/_plugin_update_toolchain index 310596e..c77abf9 100644 --- a/support/functions/_plugin_update_toolchain +++ b/support/functions/_plugin_update_toolchain @@ -1211,7 +1211,7 @@ _create_config(){ if [ ! -f "$configtemplate" ];then #check existing config template file echo -e "${r_l}\nERROR -> ${txt_s3tup_msg_create_config_template_not_found}${re_}" && _paktc_timer 10; return 1; - elif [ ! "$(which jq)" ];then #check existing jq + elif [ ! "$(type -pf jq)" ];then #check existing jq echo -e "${r_l}\nCHECK -> ${txt_s3tup_msg_create_config_jq_not_found}\n${y_l}apt install jq\n${re_}" && _paktc_timer 10; return 1; else #copy the config template file diff --git a/support/functions/_profiles b/support/functions/_profiles index 91eb2c1..c5d0ee1 100644 --- a/support/functions/_profiles +++ b/support/functions/_profiles @@ -106,12 +106,21 @@ _create_native_profile(){ [ ! -d "$tcdir/native/bin" ] && mkdir -p "$tcdir/native/bin" cd "$tcdir/native/bin" - g="$(which gcc)" - stripvar="$(which strip)" - strip_link="$($g -dumpmachine)-strip" - compiler_link="$($g -dumpmachine)-gcc" - [ -L "$compiler_link" ] || ln -sf "$g" "$compiler_link" - [ -L "$strip_link" ] || ln -sf "$stripvar" "$strip_link" + g="$(type -pf gcc)" + gpp="$(type -pf g++)" + stripvar="$(type -pf strip)" + if [ -f $g ]; then + compiler_link="$($g -dumpmachine)-gcc" + [ -L "$compiler_link" ] || ln -sf "$g" "$compiler_link" + fi + if [ -f $gpp ]; then + gpp_link="$($g -dumpmachine)-g++" + [ -L "$gpp_link" ] || ln -sf "$gpp" "$gpp_link" + fi + if [ -f $stripvar ]; then + strip_link="$($g -dumpmachine)-strip" + [ -L "$strip_link" ] || ln -sf "$stripvar" "$strip_link" + fi cd "$tccfgdir" cat << EOF > native diff --git a/support/functions/_sys_check b/support/functions/_sys_check index 6a2680f..20354cf 100644 --- a/support/functions/_sys_check +++ b/support/functions/_sys_check @@ -13,7 +13,7 @@ prerequisites(){ do if hash "$e" 2>/dev/null then - einfo=$(which "$e") + einfo=$(type -pf "$e") printf -v pad %40s e=$e$pad e=${e:0:15}