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,17 +19,29 @@ ...@@ -19,17 +19,29 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA. # 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 # Return 0 if package $1 is installed on the system, >0 otherwise
printf "Linux Educacional $(cat /etc/le_version)" function isInstalled () {
(dpkg -l minicom-client-config | grep -q '^ii' || dpkg --get-selections | grep "$1" | grep -q 'install$'
dpkg -l minicom-server-config | grep -q '^ii') > /dev/null 2>&1 && printf " mc" }
# 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" 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 elif test "${DISTRO}" = "Ubuntu" -a -f "/usr/lib/edu/fbedu/tutorial.htm"; then
printf "Linux Educacional\n" printf "Linux Educacional\n"
# Mandriva or Fedora
elif test "${DISTRO}" = "Mandriva" -o "${DISTRO}" = "Fedora"; then elif test "${DISTRO}" = "Mandriva" -o "${DISTRO}" = "Fedora"; then
head -n 1 /etc/issue head -n 1 /etc/issue
# Other...
elif test "${DISTRO}" = "Welcome"; then elif test "${DISTRO}" = "Welcome"; then
cut -sd "\\" -f1 /etc/issue | cut -d ' ' -f3- cut -sd "\\" -f1 /etc/issue | cut -d ' ' -f3-
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment