Added hack to get distro for arch, which has a bug about empty /etc/arch-release and jumbled /etc/issue

This commit is contained in:
inxi-svn 2008-10-30 22:04:26 +00:00
parent 696ee1b3e7
commit c63f96f40e

11
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 0.2.3 #### version: 0.2.4
#### Date: October 30 2008 #### Date: October 30 2008
######################################################################## ########################################################################
#### inxi is a fork of infobash, the original bash sys info script by locsmif #### inxi is a fork of infobash, the original bash sys info script by locsmif
@ -12,6 +12,10 @@
#### Gaim/Pidgin, Weechat, KVIrc and Kopete. #### Gaim/Pidgin, Weechat, KVIrc and Kopete.
#### Original infobash author and copyright holder: #### Original infobash author and copyright holder:
#### Copyright (C) 2005-2007 Michiel de Boer a.k.a. locsmif <infobash@rebelhomicide.demon.nl> #### Copyright (C) 2005-2007 Michiel de Boer a.k.a. locsmif <infobash@rebelhomicide.demon.nl>
#### inxi version: Copyright (C) 2008 Warren Scott Rogers & Harald Hope
####
#### Current script home page: http://techpatterns.com/forums/about1131.html
#### Script svn: http://code.google.com/p/inxi
#### ####
#### This program is free software; you can redistribute it and/or modify #### This program is free software; you can redistribute it and/or modify
#### it under the terms of the GNU General Public License as published by #### it under the terms of the GNU General Public License as published by
@ -870,6 +874,11 @@ get_distro_data()
## note: figure out a more readable way to achieve whatever is intended here ## ## note: figure out a more readable way to achieve whatever is intended here ##
: ${distro:=Unknown distro o_O} : ${distro:=Unknown distro o_O}
# this handles an arch bug where /etc/arch-release is empty and /etc/issue is corrupted
if [ -n "$( grep -i 'arch linux' <<< $distro )" ]
then
distro='Arch Linux'
fi
echo "$distro" echo "$distro"
} }