Skip to content
Snippets Groups Projects
Commit a4d68608 authored by Diego Giovane Pasqualin's avatar Diego Giovane Pasqualin
Browse files

Fix #2293: Accept two names for the MC linux distro

parent 1c8adf65
No related branches found
No related tags found
No related merge requests found
......@@ -19,21 +19,33 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
DISTRO=$(cut -sd ' ' -f1 /etc/issue | head -n 1)
DISTRO=$(cut -sd ' ' -f1 /etc/issue | head -n 1 2>/dev/null)
if test -f "/etc/le_version"; then
printf "Linux Educacional $(cat /etc/le_version)"
(dpkg -l minicom-client-config | grep -q '^ii' ||
dpkg -l minicom-server-config | grep -q '^ii') > /dev/null 2>&1 && printf " mc"
printf "\n"
# Return 0 if package $1 is installed on the system, >0 otherwise
function isInstalled () {
dpkg --get-selections | grep "$1" | grep -q 'install$'
}
# Linux Comunicações
if isInstalled "minicom-client-config" ||
isInstalled 'minicom-server-config'; then
printf "Linux Comunicações"
test -f "/etc/mc_version" && printf " $(cat /etc/mc_version)"
printf "\n"
# Linux Educacional > 3
elif test -f "/etc/le_version"; then
printf "Linux Educacional $(cat /etc/le_version)\n"
# Linux Educacional < 3
elif test "${DISTRO}" = "Ubuntu" -a -f "/usr/lib/edu/fbedu/tutorial.htm"; then
printf "Linux Educacional\n"
elif test "${DISTRO}" = "Mandriva" -o "${DISTRO}" = "Fedora"; then
head -n 1 /etc/issue
printf "Linux Educacional\n"
# Mandriva or Fedora
elif test "${DISTRO}" = "Mandriva" -o "${DISTRO}" = "Fedora"; then
head -n 1 /etc/issue
# Other...
elif test "${DISTRO}" = "Welcome"; then
cut -sd "\\" -f1 /etc/issue | cut -d ' ' -f3-
cut -sd "\\" -f1 /etc/issue | cut -d ' ' -f3-
else
cut -sd "\\" -f1 /etc/issue
cut -sd "\\" -f1 /etc/issue
fi
exit $?
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment