mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
line counter test
This commit is contained in:
parent
2339a67c01
commit
ce33ac4884
47
inxi
47
inxi
|
@ -884,7 +884,7 @@ get_start_client()
|
||||||
# Since Konversation 1.0, the DCOP interface has changed a bit: dcop "$DCPORT" Konversation ..etc
|
# Since Konversation 1.0, the DCOP interface has changed a bit: dcop "$DCPORT" Konversation ..etc
|
||||||
# becomes : dcop "$DCPORT" default ... or dcop "$DCPORT" irc ..etc. So we check for versions smaller
|
# becomes : dcop "$DCPORT" default ... or dcop "$DCPORT" irc ..etc. So we check for versions smaller
|
||||||
# than 1 and change the DCOP parameter/object accordingly.
|
# than 1 and change the DCOP parameter/object accordingly.
|
||||||
if [[ ${T2} < 1 ]];then
|
if [[ ${T2} -lt 1 ]];then
|
||||||
DCOPOBJ="Konversation"
|
DCOPOBJ="Konversation"
|
||||||
fi
|
fi
|
||||||
IRC_CLIENT="Konversation"
|
IRC_CLIENT="Konversation"
|
||||||
|
@ -1708,7 +1708,7 @@ get_hard_drive_data_advanced()
|
||||||
IFS=","
|
IFS=","
|
||||||
a_temp_working=( ${A_HDD_DATA[$i]} )
|
a_temp_working=( ${A_HDD_DATA[$i]} )
|
||||||
IFS="$ORIGINAL_IFS"
|
IFS="$ORIGINAL_IFS"
|
||||||
if [[ ${#a_temp_scsi[@]} > 0 ]];then
|
if [[ ${#a_temp_scsi[@]} -gt 0 ]];then
|
||||||
for (( j=0; j < ${#a_temp_scsi[@]}; j++ ))
|
for (( j=0; j < ${#a_temp_scsi[@]}; j++ ))
|
||||||
do
|
do
|
||||||
## ok, ok, it's incomprehensible, search /dev/disk/by-id for a line that contains the
|
## ok, ok, it's incomprehensible, search /dev/disk/by-id for a line that contains the
|
||||||
|
@ -2620,7 +2620,7 @@ print_networking_ip_data()
|
||||||
print_partition_data()
|
print_partition_data()
|
||||||
{
|
{
|
||||||
local a_partition_working='' partition_used='' swap='' partition_data='' partition_data_2=''
|
local a_partition_working='' partition_used='' swap='' partition_data='' partition_data_2=''
|
||||||
local partition_data_3='' partition_data_4='' partition_data_5='' counter=0
|
local partition_data_3='' partition_data_4='' partition_data_5='' counter=1 line_max=150
|
||||||
|
|
||||||
# set A_PARTITION_DATA
|
# set A_PARTITION_DATA
|
||||||
get_partition_data
|
get_partition_data
|
||||||
|
@ -2642,19 +2642,38 @@ print_partition_data()
|
||||||
else
|
else
|
||||||
swap=''
|
swap=''
|
||||||
fi
|
fi
|
||||||
if [[ $counter -lt 3 ]];then
|
# because these lines can vary widely, using dynamic length handling here
|
||||||
|
case $counter in
|
||||||
|
1)
|
||||||
partition_data="$partition_data${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
|
partition_data="$partition_data${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
|
||||||
elif [[ $counter -lt 6 ]];then
|
# echo 1 $( wc -c <<< $partition_data )
|
||||||
partition_data_2="$partition_data_2${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
|
if [[ $( wc -c <<< $partition_data ) -gt $line_max ]];then
|
||||||
elif [[ $counter -lt 9 ]];then
|
counter=2
|
||||||
partition_data_3="$partition_data_3${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
|
|
||||||
elif [[ $counter -lt 12 ]];then
|
|
||||||
partition_data_4="$partition_data_4${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
|
|
||||||
else
|
|
||||||
partition_data_5="$partition_data_5${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
|
|
||||||
fi
|
fi
|
||||||
# we can't use the $i counter here because it doesn't always increment
|
;;
|
||||||
((counter++))
|
2)
|
||||||
|
partition_data_2="$partition_data_2${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
|
||||||
|
# echo 2 $( wc -c <<< $partition_data_2 )
|
||||||
|
if [[ $( wc -c <<< $partition_data_2 ) -gt $line_max ]];then
|
||||||
|
counter=3
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
partition_data_3="$partition_data_3${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
|
||||||
|
if [[ $( wc -c <<< $partition_data_3 ) -gt $line_max ]];then
|
||||||
|
counter=4
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
4)
|
||||||
|
partition_data_4="$partition_data_4${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
|
||||||
|
if [[ $( wc -c <<< $partition_data_4 ) -gt $line_max ]];then
|
||||||
|
counter=5
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
partition_data_5="$partition_data_5${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
partition_data=$( create_print_line "Partition:" "$partition_data" )
|
partition_data=$( create_print_line "Partition:" "$partition_data" )
|
||||||
|
|
Loading…
Reference in a new issue