#!/bin/bash # FIXME # Currently script supports only polish (pl_PL.UTF-8) locale. # # ENGLISH: # ## LibreOffice installer for Ubuntu and Ubuntu-based system ## License: GPLv3 ## Author: Admc ## Website: http://www.ubuntu-pomoc.org/ ## Copyright (C) 2012 Admc ## ## Example of commentary: ## Commentary in English / Commentary in Polish ## or ## Commentary in English ## Commentary in Polish ## ## 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 ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . ## # # # POLISH: # ## Instalator LibreOffice dla Ubuntu i systemów na nim bazujących ## Licencja: GPLv3 ## Autor: Admc ## Strona: http://www.ubuntu-pomoc.org/ ## Copyright (C) 2012 Admc ## ## Przykład komentarza: ## Komentarz po angielsku / Komentarz po polsku ## lub ## Komentarz po angielsku ## Komentarz po polsku ## ## Niniejszy program jest wolnym oprogramowaniem: możesz go rozprowadzać ## dalej i/lub modyfikować na warunkach Powszechnej Licencji Publicznej GNU, ## wydanej przez Free Software Foundation, w wersji 3 lub (twój wybór) nowszej. ## ## Niniejszy program rozpowszechniany jest z nadzieją, iż będzie on użyteczny, ## ale BEZ JAKIEJKOLWIEK GWARANCJI, nawet bez dorozumianej gwarancji ## lub PRZYDATNOŚCI DO OKREŚLONEGO CELU. Zobacz Powszechną Licencję ## Publiczną GNU aby dowiedzieć się więcej. ## ## Do programu powinna być dołączona kopia Powszechnej Licencji Publicznej GNU. ## Jeśli nie, zobacz . #--------------------------- # Version / Wersja VESRION=0.2.96 #--------------------------- # TRANSLATEABLE STRING / ŁAŃCUCHY DO TŁUMACZENIA # WARNING # Some translatable string are not here because they need some variables to be set # before they can be loaded. If you want to translate this script, please search for # "case $LANG in" # OSTRZEŻENIE # Niektóre łańcuchy do tłumaczenia nie znajdują się tutaj gdyż potrzebują innych zmiennych # które muszą być najpierw zadeklarowane. Jeśli chcesz przedtłumaczyć ten skrypt szukaj # "case $LANG in" #--------------------------- load_translatable_strings(){ case $LANG in pl*) help_text="Instalator LibreOffice $VESRION Opcje: -v --version Wyświetl Informacje o wersji -h --help Wyświetl tą informację -l --do-not-download Nie pobieraj plików -D --download-only Tylko pobierz Libre Office (nie instaluj) --disable-sha-check Nie sprawdzaj sumy sha256 (niezalecane) -d --directory=KATALOG Ręcznie ustaw katalog tymczasowy --force-32bit Wymuś wersję 32-bitową (niezalecane) --force-64bit Wymuś wersję 64-bitową (niezalecane) -k --force-kde Wymuś włączenie integracji z KDE --integrate-with-kde Tylko zintegruj z KDE (wymaga zainstalowanego LO) -y --no-questions Udzielaj domyślnej odpowiedzi na pytania -R --remove-tmp-files Usuń pliki tymczasowe -C --check-last-vesrion Sprawdź najnowszą wersję Libre Office -u --uninstall Usuń Libre Office --wipe Usuń Libre Office i pliki konfiguracyjne" version_text="Instalator LibreOffice $VESRION\nTo jest wolne oprogramowanie: masz prawo je zmieniać i rozpowszechniać.\nAutor nie daje ŻADNYCH GWARANCJI w granicach dozwolonych prawem." temp_dir_error_text="$program_name: Nie podano katalogu tymczasowego" uninstall_text="Deinstalator Libre Office $VESRION\nTen skrypt pomoże ci odinstalować wszystkie wersje Libre Office z tego komputera" enter_root_pass_to_start_removing_text="Podaj hasło administratora, jest ono wymagane do rozpoczęcia usuwania: " enter_root_pass_to_continue_removing_text="Podaj hasło administratora, jest ono wymagane do kontynuowania usuwania: " enter_root_pass_to_integrate_with_kde="Podaj hasło administratora, jest ono wymagane do włączenia integracji z KDE: " enter_root_pass_to_continue_installation_text="Podaj hasło administratora, jest ono wymagane do ukończenia instalacji: " removing_complete_text="Usuwanie Libre Office zakończone." wipe_text="Deinstalator Libre Office $VESRION\nTen skrypt pomoże ci odinstalować wszystkie wersje oraz pliki konfiguracyjne\nLibre Office\nOSTRZEŻENIE: KONFIGURACJA LIBREOFFICE ZOSTANIE USUNIĘTA\nZaleca się użyć funkcji '--uninstall'." wipe_complete_text="Usuwanie Libre Office i plików konfiguracyjnych zakończone." error_download_and_not_download_text="E: $program_name: Błędne opcje\nNie można jednocześnie pobierać i nie pobierać." start_installation_question_text="Rozpocząć instalację?" error_linux_not_detected_text="Niewspierany system operacyjny (skrypt działa tylko na Linuxie)." warning_distro_other_than_ubuntu_text="OSTRZEŻENIE: Wykryto, że używasz dystrybucji innej niż Ubuntu.\nSkrypt ten jest przeznaczony tylko dla Ubuntu i może nie działać poprawnie na uruchomionym systemie.\nCzy chcesz kontynować mimo to?" warning_distro_detect_failed_text="OSTRZEŻENIE: Nie udało się wykryć dystrybucji.\nSkrypt ten jest przeznaczony tylko dla Ubuntu i może nie działać poprawnie na innym systemie.\nJeżeli używasz Ubuntu zainstaluj pakiet \"lsb-release\" i uruchom ponownie ten skrypt.\nCzy chcesz kontynować mimo to?" system32bit_text="Twój system jest 32-bitowy" system64bit_text="Twój system jest 64-bitowy" arch_detect_error_text="Nieobsługiwana lub błędnie wykryta architektura procesora\nMożesz ustawić architekurę procesora ręcznie NA WŁASNĄ ODPOWIEDZIALNOŚĆ\n\t1) 32 bity\n\t2) 64 bity\nDowolny inny klawisz zamknąć instalator" last_version_checking_text="Sprawdzanie najnowszej wersji LibreOffice..." checking_error_text="Wystąpił błąd przy sprawdzaniu najnowszej wersji LibreOffice, sprawdź połączenie z internetem." lo_already_installed_from_repo="Wykryto że LibreOffice jest już zainstalowany z repozytorium.\nZaleca się usunięcie go przed instalacją wersji ze strony DF aby uniknąć\nkonflików.\nCzy chcesz to zrobić?" lo_lastest_version_already_installed_text="Masz już zainstalowaną najnowszą wersję LibreOffice. Co chcesz zrobić?\n\t1) Nadpisz instalację\n\t2) Nadpisz instalację z uprzednim usunięciem poprzedniej\nDowolny inny klawisz aby zamknąć instalator" older_version_installed_installation_will_be_overwritten_text="Masz już zainstalowaną starszą wersję LibreOffice. Instalacja zostanie nadpisana." corrupted_files_error_text="Pliki tymczasowe są USZKODZONE\nUruchom skrypt ponownie aby ponowić próbę instalacji." kde_detected_text="Wykryto że twoje środowisko graficzne to KDE,\nczy chcesz włączyć integrację LibreOffice z KDE?" installation_complete_text="Instalacja została zakończona, czy chcesz usunąć pliki tymczasowe?" program_grettings_text="Instalator LibreOffice $VESRION\nTen skrypt umożliwia łatwą instalację LibreOffice ze strony Document Fundation" Y_n=" [T/n] " y_N=" [t/N] " ;; *) help_text="LibreOffice installer $VESRION Options: -v --version Display version information -h --help Display this information -l --do-not-download Do not download files -D --download-only Do not install LibreOffice (donload files only) --disable-sha-check Do not check sha256 (not recommended) -d --directory=KATALOG Set custom temporary directory --force-32bit Force 32bit version (not recommended) --force-64bit Force 64bit version (not recommended) -k --force-kde Force enable integration with KDE --integrate-with-kde Only integrate with KDE (requires installed LO) -y --no-questions Use default answers to questions -R --remove-tmp-files Remove temporary files -C --check-last-vesrion Check st version of Libre Office -u --uninstall Remove Libre Office --wipe Remove Libre Office and configuration files" version_text="LibreOffice installer $VESRION\nThis is free software: you have the right to modify and distribute.\nThe author makes NO WARRANTY to the extent permitted by law." temp_dir_error_text="$program_name: Temporary directory not specified" uninstall_text="LibreOffice uninstaller $VESRION\nThis script will help you to uninstall all versions of LibreOffice from this computer" enter_root_pass_to_start_removing_text="Enter the root password, it's required to start uninstalling: " enter_root_pass_to_continue_removing_text="Enter the root password, it's required to continue uninstalling: " enter_root_pass_to_integrate_with_kde="Enter the root password, it's required to enable integration with KDE: " enter_root_pass_to_continue_installation_text="Enter the root password, it is required to complete the installation: " removing_complete_text="Uninstalling Libre Office completed." wipe_text="LibreOffice uninstaller $VESRION\nThis script will help you to uninstall all versions of Libre Office\nand it's config files\nWARNING: LIBREOFFICE CONFIGURATION WILL BE DELETED\nIt is strongly recommended to use the '--uninstall' instead." wipe_complete_text="Uninstalling Libre Office and removing config files completed." error_download_and_not_download_text="E: $program_name: Wrong options\nIt's impossible to download and not download at the same time." start_installation_question_text="Start installation?" error_linux_not_detected_text="Unsupported operating system (script works only on Linux)." warning_distro_other_than_ubuntu_text="WARNING: We have detected that you are using a distribution other than Ubuntu.\nThis script is only for Ubuntu and may not work properly on a running system.\nDo you want to continue anyway?" warning_distro_detect_failed_text="WARNING: Failed to detect distribution.\nThis script is only for Ubuntu and may not work properly on another system.\nIf you are using Ubuntu install \"lsb-release \" package and restart the script.\nDo you want to continue anyway?" system32bit_text="Your system is 32bit" system64bit_text="Your system is 64bit" arch_detect_error_text="Unsupported or wrongly detected processor architecture\nM You can manually set the CPU architecture AT YOUR OWN RISK\n\t1) 32bit\n\t2) 64bit\nPress any other key to close the installer" last_version_checking_text="Checking the latest version of LibreOffice..." checking_error_text="An error occurred while checking the latest version of LibreOffice, check your internet connection." lo_already_installed_from_repo="We detected that LibreOffice is already installed from a repository.\n It is recommended to remove it before installing the version from the DF website\nto avoid conflicts.\nDo you want to do it?" lo_lastest_version_already_installed_text="You have the latest version of LibreOffice installed. What you want to do?\n\t1) Overwrite installation\n\t2) Overwrite installation with prior removal of the previous\nAny other key to quit the installer" older_version_installed_installation_will_be_overwritten_text="You have an older version of LibreOffice installed. The installation will be overwritten." corrupted_files_error_text="Temporary files are CORRUPTED\nRun the script again to retry the installation." kde_detected_text="We detected that your desktop environment is KDE.\nDo you want to enable the integration of LibreOffice with KDE?" installation_complete_text="The installation is complete, do you want to delete temporary files?" program_grettings_text="LibreOffice installer $VESRION\nThis script allows easy installation of LibreOffice from the\nDocument Foundation website." Y_n=" [Y/n] " y_N=" [y/N] " ;; esac } #--------------------------- # FUNCTIONS / FUNKCJE #--------------------------- # Parameters entered from the console - always call this function with $@ # Parametry wpisane z konsoli - funkcję wywoływać zawsze z $@ parameters(){ while [ "$1" ] ; do case "$1" in "--help"|"-h") echo -e "$help_text" exit 0; ;; "--version"|"-v") echo -e "$version_text" exit 0; ;; "-d") if [ "$2" = "" ]; then echo -e "$temp_dir_error_text" exit 1; fi tmpdir="$2" shift; ;; "--directory="*) tmpdir=`echo -e "$1" | cut -c 13-` if [ "$tmpdir" = "" ]; then echo -e "$temp_dir_error_text" exit 1; fi ;; "--uninstall"|"-u") echo -e "$uninstall_text" sudo -p "$enter_root_pass_to_start_removing_text" apt-get -y remove "libreoffice*.*" || exit 1; echo -e "$removing_complete_text" exit 0; ;; "--wipe") echo -e "$wipe_text" sudo -p "$enter_root_pass_to_start_removing_text" apt-get -y purge "libreoffice*.*" || exit 1; sudo -p "$enter_root_pass_to_continue_removing_text" rm -rf /opt/libreoffice* || exit 1; rm -rf "$HOME/.libreoffice" rm -rf "$HOME/.config/libreoffice" echo -e "$wipe_complete_text" exit 0; ;; "--remove-tmp-files"|"-R") removefilesnow=true ;; "--check-last-vesrion"|"-C") check_last_lo_version exit 0; ;; "--do-not-download"|"-l") downloadfiles=false if [ "$do_not_install" = "true" ]; then echo -e "$error_download_and_not_download_text" exit 1; fi ;; "--disable-sha-check") checksha256sum=false ;; "--no-questions"|"-y") askquestions=false ;; "--download-only"|"-D") if [ "$downloadfiles" = "false" ]; then echo -e "$error_download_and_not_download_text" exit 1; fi do_not_install=true ;; "--force-32bit") archdir=x86 archfile=x86 arch_forced=true case $LANG in pl*) arch_forced_warning_text="OSTRZEŻENIE: Wymuszono architekturę procesora ($archdir)\nProgram może nie działać poprawnie!" ;; *) arch_forced_warning_text="WARNING: Wrocessor architecture forced ($archdir)\nProgram may not work properly!" ;; esac echo -e "$arch_forced_warning_text" ;; "--force-64bit") archdir=x86_64 archfile=x86-64 arch_forced=true case $LANG in pl*) arch_forced_warning_text="OSTRZEŻENIE: Wymuszono architekturę procesora ($archdir)\nProgram może nie działać poprawnie!" ;; *) arch_forced_warning_text="WARNING: Wrocessor architecture forced ($archdir)\nProgram may not work properly!" ;; esac echo -e "$arch_forced_warning_text" ;; "--force-kde"|"-k") force_kde=true ;; "--integrate-with-kde") enable_kde_integration exit 0; ;; *) first_option=$1 case $LANG in pl*) error_unknown_option_text="$program_name: Nieznana opcja '$first_option'\nWykonaj '$program_name --help' dla uzyskania informacji." ;; *) error_unknown_option_text="$program_name: Unknown option '$first_option'\nRun '$program_name --help' for more information." ;; esac echo -e "$error_unknown_option_text" exit 1; ;; esac shift done } #--------------------------- # Pre-installation tests / Testy przedinstalacyjne tests(){ detect_linux set_variables detect_ubuntu check_last_lo_version if [ "$do_not_install" != "true" ]; then detect_lo_from_repo detect_lo_from_df_website fi if [ "$arch_forced" != "true" ]; then detect_arch fi } #--------------------------- # Main installation / Instalacja właściwa install_lo(){ echo -en "$start_installation_question_text""$Y_n" read_from_stdin a uppercase $a ; a="$anwser" if [ "$a" = "N" ]; then exit 0; fi # Create temp dir / Tworzenie katalogu tymczasowego mkdir -p $tmpdir # Change relative path into absolute path # Przekształcenie ścieżki względnej w ścieżkę bezwzględną tmpdir=`cd $tmpdir; pwd` # Download temp files / Pobieranie plików tymczasowych if [ "$downloadfiles" != "false" ]; then download_lo_files fi # Check sha-256 sum / Sprawdzanie sumy sha-256 if [ "$checksha256sum" != "false" ]; then check_sha256sum fi # Extract files / Rozpakowywanie plików extract_files # Installation / Instalacja install_deb_files } #--------------------------- # Set variables / Ustaw zmienne set_variables(){ # Katalogi firstdir=$pwd if [ "$tmpdir" = "" ]; then tmpdir=$HOME/.cache/libreoffice-installer fi # Domyślnie nie usuwamy danych LO przed instalacją nowej wersji wipedata=false } #--------------------------- # Check that Linux is kernel / Sprawdź czy jądro to Linux detect_linux(){ if [ `uname -s` != "Linux" ]; then echo -e "$error_linux_not_detected_text" exit 1; fi } #--------------------------- # Check that Ubuntu is distro / Sprawdź czy dystrybucja to Ubuntu detect_ubuntu(){ if test -x "`which lsb_release 2>/dev/null`"; then DISTRO=`lsb_release -s -i` if [ "$DISTRO" != "Ubuntu" ]; then echo -en "$warning_distro_other_than_ubuntu_text""$y_N" read_from_stdin a uppercase $a ; a="$anwser" case $LANG in pl*) if [ "$a" != "T" ]; then exit 0; fi ;; *) if [ "$a" != "Y" ]; then exit 0; fi ;; esac fi else echo -en "$warning_distro_detect_failed_text""$y_N" read_from_stdin a uppercase $a ; a="$anwser" case $LANG in pl*) if [ "$a" != "T" ]; then exit 0; fi ;; *) if [ "$a" != "Y" ]; then exit 0; fi ;; esac fi } #--------------------------- # Detect processor architecture/ Detekcja architektury procesora detect_arch(){ case `arch` in i[3456789]86|x86|i86pc) echo -e "$system32bit_text" archdir=x86 archfile=x86 ;; x86_64|amd64|AMD64) echo -e "$system64bit_text" archdir=x86_64 archfile=x86-64 ;; *) echo -e "$arch_detect_error_text" read_from_stdin choosearch case "$choosearch" in "1") archdir=x86 && archfile=x86;; "2") archdir=x86_64 && archfile=x86-64;; *) exit 0;; esac ;; esac } #--------------------------- # Check LibreOffice version / Sprawdzanie wersji LibreOffice check_last_lo_version(){ echo -e "$last_version_checking_text" lolastversion=`wget http://www.libreoffice.org/download/ -q -T 10 -O - | grep -m1 -o "version [0-9].[0-9].." | awk '{print $2}'` lolastversion_second_number=`echo -e $lolastversion | cut -c 3` if [ "$lolastversion" = "" ]; then echo -e "$checking_error_text" exit 1; fi case $LANG in pl*) lastest_version_is_text="Ostatnia wersja LibreOffice to: '$lolastversion'" ;; *) lastest_version_is_text="The latest version of LibreOffice is: '$lolastversion'" ;; esac echo -e "$lastest_version_is_text" } #--------------------------- # Check if LO is already installed from repository # Sprawdzanie czy LO jest już zainstalowane z repo detect_lo_from_repo(){ if test -x "`which libreoffice 2>/dev/null`"; then echo -en "$lo_already_installed_from_repo""$Y_n" read_from_stdin a uppercase $a ; a="$anwser" if [ "$a" != "N" ]; then wipedata=true fi fi } #--------------------------- # Check if LO is already installed from DF website # Sprawdzanie czy LO ze strony DF jest zainstalowane detect_lo_from_df_website(){ lofromdffolder=`ls /opt | grep libreoffice | tail -n 1` if [ "$lofromdffolder" != "" ]; then loinstalledver=`dpkg -l | grep -m 1 libreoffice[0-9].[0-9] | grep ii | grep -o [0-9].[0-9].[0-9] | head -n 1` loinstalledver_second_number=`echo -e $loinstalledver | cut -c 3` if [ "$loinstalledver" = "$lolastversion" ]; then echo -e "$lo_lastest_version_already_installed_text" read_from_stdin chooseinst case "$chooseinst" in "1") wipedata=false ;; "2") wipedata=true ;; *) exit 0;; esac fi if [ "$loinstalledver" != "$lolastversion" ]; then echo -e "$older_version_installed_installation_will_be_overwritten_text" fi if [ "$loinstalledver_second_number" != "$lolastversion_second_number" ]; then wipedata=true fi fi } #--------------------------- # Download temp files / Pobieranie plików tymczasowych download_lo_files(){ wget http://download.documentfoundation.org/libreoffice/stable/$lolastversion/deb/$archdir/LibreOffice_"$lolastversion"_Linux_"$archfile"_deb.tar.gz -O "$tmpdir/install.tar.gz" wget http://download.documentfoundation.org/libreoffice/stable/$lolastversion/deb/$archdir/LibreOffice_"$lolastversion"_Linux_"$archfile"_deb_langpack_pl.tar.gz -O "$tmpdir/langpack.tar.gz" wget http://download.documentfoundation.org/libreoffice/stable/$lolastversion/deb/$archdir/LibreOffice_"$lolastversion"_Linux_"$archfile"_deb_helppack_pl.tar.gz -O "$tmpdir/helppack.tar.gz" } #--------------------------- # Check sha-256 sum / Sprawdzanie sumy sha-256 check_sha256sum(){ sha256instorig=`wget http://download.documentfoundation.org/libreoffice/stable/$lolastversion/deb/$archdir/LibreOffice_"$lolastversion"_Linux_"$archfile"_deb.tar.gz.sha256 -q -O - | grep Lib0* | awk '{print $1}'` sha256instdown=`sha256sum "$tmpdir/install.tar.gz" | awk '{print $1}'` sha256langorig=`wget http://download.documentfoundation.org/libreoffice/stable/$lolastversion/deb/$archdir/LibreOffice_"$lolastversion"_Linux_"$archfile"_deb_langpack_pl.tar.gz.sha256 -q -O - | grep Lib0* | awk '{print $1}'` sha256langdown=`sha256sum "$tmpdir/langpack.tar.gz" | awk '{print $1}'` sha256helporig=`wget http://download.documentfoundation.org/libreoffice/stable/$lolastversion/deb/$archdir/LibreOffice_"$lolastversion"_Linux_"$archfile"_deb_helppack_pl.tar.gz.sha256 -q -O - | grep Lib0* | awk '{print $1}'` sha256helpdown=`sha256sum "$tmpdir/helppack.tar.gz" | awk '{print $1}'` if [ "$sha256instorig" != "$sha256instdown" -o "$sha256langorig" != "$sha256langdown" -o "$sha256helporig" != "$sha256helpdown" ]; then clear # DEBUG echo -e "$sha256instorig\n$sha256instdown\n$sha256helporig\n$sha256helpdown\n$sha256langorig\n$sha256langdown" echo -e "$corrupted_files_error_text" exit 1; fi } #--------------------------- # Extract files / Rozpakowywanie plików extract_files(){ tar -C "$tmpdir/" -xvzf "$tmpdir/install.tar.gz" tar -C "$tmpdir/" -xvzf "$tmpdir/helppack.tar.gz" tar -C "$tmpdir/" -xvzf "$tmpdir/langpack.tar.gz" } #--------------------------- # Detect KDE / Wykrycie KDE detect_kde(){ if [ "$force_kde" = "true" ]; then enable_kde_integration else if [ x"$KDE_FULL_SESSION" = x"true" ]; then echo -en "$kde_detected_text""$Y_n" read_from_stdin a uppercase $a ; a="$anwser" if [ "$a" != "N" ]; then enable_kde_integration fi fi fi } #--------------------------- # Enable KDE integration / Włączenie integracji z KDE enable_kde_integration(){ installdir=`ls /opt |grep libreoffice` libstdc_path=`find "/opt/$installdir" -name *libstdc++* | grep libstdc++ | grep -v orig` if [ "$libstdc_path" != "" ]; then sudo -p "$enter_root_pass_to_integrate_with_kde" mv $libstdc_path "$libstdc_path"_orig || exit 1; fi } #--------------------------- # Installation / Instalacja install_deb_files(){ clear ( cd $tmpdir if $wipedata ; then sudo -p "$enter_root_pass_to_continue_installation_text" apt-get -y purge "libreoffice*.*" || exit 1; old_lo_dir=`ls /opt |grep -m1 libreoffice` if [ "$old_lo_dir" != "" ]; then dir_to_delete="/opt/$old_lo_dir" sudo -p "$enter_root_pass_to_continue_installation_text" rm -rf "$dir_to_delete" || exit 1; fi fi sudo -p "$enter_root_pass_to_continue_installation_text" su -c "find . -name *.deb | xargs dpkg -i" || exit 1; )||exit 1; clear # KDE integration / Integracja z KDE detect_kde echo -en "$installation_complete_text""$Y_n" read_from_stdin a uppercase $a ; a="$anwser" if [ "$a" = "N" ]; then exit 0; fi rm_tmp_files } #--------------------------- # Remove temp files / Usuwanie plików tymczasowych rm_tmp_files(){ if [ "$tmpdir" = "" ]; then tmpdir=$HOME/.cache/libreoffice-installer fi rm -rf $tmpdir } #--------------------------- # Read text from keyboard / Wczytaj tekst z klawiatury read_from_stdin(){ if [ "$askquestions" != "false" ]; then read $1 fi } #--------------------------- # Only downlaod / Tylko pobieranie only_download_lo_files(){ tests # Create temp dir / Tworzenie katalogu tymczasowego mkdir -p $tmpdir # Change relative path into absolute path # Przekształcenie ścieżki względnej w ścieżkę bezwzględną tmpdir=`cd $tmpdir; pwd` # Download temp files / Pobieranie plików tymczasowych download_lo_files exit 0; } #--------------------------- # Convert lowercase to uppercase / Zamienia małe litery na duże # USAGE: uppercase "$some_variable" ; some_variable="$anwser" # UŻYCIE: uppercase "$jakas_zmienna" ; jakas_zmienna="$anwser" uppercase(){ anwser=$1 anwser=`echo -e "$anwser" | tr '[:lower:]' '[:upper:]'` } #--------------------------- # END OF FUNCTIONS / KONIEC FUNKCJI #--------------------------- # BEGINNING OF SCRIPT / POCZĄTEK SKRYPTU #--------------------------- program_name=$0 load_translatable_strings parameters $@ if [ "$do_not_install" ]; then only_download_lo_files fi if [ "$removefilesnow" ]; then rm_tmp_files exit 0; fi clear echo -e "$program_grettings_text" # Pre-installation tests / Testy przedinstalacyjne tests # Main installation / Instalacja właściwa install_lo exit 0