├── EN_README.md ├── LICENSE ├── README.md ├── script.sh └── url_links.txt /EN_README.md: -------------------------------------------------------------------------------- 1 | # GUI Bash Script --wget 2 | 3 | Bash script programming - GUI for wget command 4 | ## :computer: What is the GUI? 5 | 6 | GUI (Graphical User Interface) are designs developed to help electronic devices use icons, icons and other visual graphics. In old generation computers and electronic devices using command-based operating system before GUI, command line was used to perform any operation. Users were performing every operation on the computer using the keyboard and commands. 7 | 8 | Later, in 1981, a group of Alan Kay, Douglas Engelbart and a group of researchers developed the first GUI in Xerox PARC so that users could use personal computers more comfortably. 9 | 10 | ## :arrow_down: What is the wget Command?? 11 | 12 | 13 | Wget is the non-interactive network downloader which is used to download files from the server even when the user has not logged on to the system and it can work in the background without hindering the current process. 14 | 15 | - GNU wget is a free utility for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies. 16 | 17 | - wget is non-interactive, meaning that it can work in the background, while the user is not logged on. This allows you to start a retrieval and disconnect from the system, letting wget finish the work. By contrast, most of the Web browsers require constant user’s presence, which can be a great hindrance when transferring a lot of data. 18 | 19 | - wget can follow links in HTML and XHTML pages and create local versions of remote web sites, fully recreating the directory structure of the original site. This is sometimes referred to as recursive downloading. While doing that, wget respects the Robot Exclusion Standard (/robots.txt). wget can be instructed to convert the links in downloaded HTML files to the local files for offline viewing. 20 | 21 | - wget has been designed for robustness over slow or unstable network connections; if a download fails due to a network problem, it will keep retrying until the whole file has been retrieved. If the server supports resuming, it will instruct the server to continue the download from where it left off. 22 | - The simplest syntax is as follows: `wget [OPTIONS] [URL]` 23 | 24 | ## :floppy_disk: Requirements 25 | You must have `zenity` and `wget` installed on your local machine. You can do these installations using the command lines mentioned below. Don't forget to update your apt-get package lists with the `sudo apt-get update` command before running the following command lines. Doing so will allow you to download the latest version of `wget`. 26 | 27 | - `sudo apt-get install zenity` 28 | - `sudo apt-get install wget` 29 | 30 | You can make sure that the downloads are successful or not by typing the following commands in the terminal. 31 | 32 | - `wget --version` 33 | - `zenity --version` 34 | 35 | ## :mag_right: Installation & Usage 36 | 37 | - In the terminal you opened in a directory, download a clone of the repo to your local machine with the following command line: 38 | -- `https://github.com/fatihes1/GUI-Bash-Script--wget.git` 39 | 40 | - After the repo is downloaded to your local machine, enter the repo directory with the `cd GUI-Bash-Script--wget` command. 41 | - The program is run with the `./script.sh` or `bash script.sh` command. 42 | - After this process, the required operations (file URL information, etc.) are given as input to the program in the user interface of the program and the program runs the necessary functions. 43 | 44 | ## :framed_picture: Program Images 45 | - The options available to the user are as follows: 46 | 47 | ![01](https://user-images.githubusercontent.com/54971670/149222447-77844b5b-14b4-4580-aa13-de741ca3f0d0.PNG) 48 | 49 | - The window where inputs such as file URL information from the user are received: 50 | 51 | ![02](https://user-images.githubusercontent.com/54971670/149222454-33a7a839-ce95-4f28-bc60-e4fd886967e8.PNG) 52 | 53 | - The window that appears in case of a problem with the download: 54 | 55 | ![03](https://user-images.githubusercontent.com/54971670/149222455-373778b5-664c-4278-97e2-dd1df306bef5.PNG) 56 | 57 | - The following window will appear when the download is successfully completed: 58 | 59 | ![04](https://user-images.githubusercontent.com/54971670/149222456-e7b8c56b-7d37-4591-b359-a01c26bb3347.PNG) 60 | 61 | - During the download of large files, the `progress bar` window appears until the download is complete: 62 | 63 | ![05](https://user-images.githubusercontent.com/54971670/149222458-4216c467-4eeb-4dbb-9867-1af4fca8952c.PNG) 64 | 65 | - The window that appears when the user wants to know the `wget` version: 66 | 67 | ![06](https://user-images.githubusercontent.com/54971670/149222459-e5f8c75c-464d-486d-9e36-137424a42c03.PNG) 68 | 69 | - The window that appears when the user wants to exit the program: 70 | 71 | ![07](https://user-images.githubusercontent.com/54971670/149222461-cce8df13-92ba-4d9c-806b-ba56ecb8a77e.PNG) 72 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Fatih Es 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GUI Bash Script --wget 2 | [Click here](EN_README.md) for English README. 3 | Bash script programming - GUI for wget command 4 | 5 | :movie_camera: Kodların anlatımı ve script dosyasının kullanımı için hazırlanan videoya [buraya](https://www.youtube.com/watch?v=g921UNfYXIo) tıklayarak ulaşabilirsiniz. 6 | 7 | ## :computer: GUI Nedir? 8 | **GUI** (Graphical User Interface), Grafiksel Kullanıcı Arayüzü, elektronik cihazların simgeler, ikonlar ve diğer görsel grafikler yardımıyla kullanmasına yardımcı olması amacıyla geliştirilmiş tasarımlardır. GUI öncesi komut bazlı işletim sistemi kullanılan eski nesil bilgisayarlar ve elektronik cihazlarda herhangi bir işlemi gerçekleştirmek için komut satırı kullanılıyordu. Kullanıcılar bilgisayar üzerindeki her işlemi klavye üzerinden ve komutları kullanarak gerçekleştiriyordu. 9 | 10 | Daha sonra kullanıcıların daha rahat kişisel bilgisayar kullanabilmesi için **1981** yılında aralarında _Alan Kay_, _Douglas Engelbart_ ve bir grup araştırmacının yer aldığı grup **Xerox PARC**'da ilk GUI'yi geliştirmiştir. 11 | 12 | ## :arrow_down: wget Komutu Nedir? 13 | 14 | Wget, kullanıcı sistemde oturum açmamış olsa bile sunucudan dosya indirmek için kullanılan ve mevcut işlemi engellemeden arka planda çalışabilen, etkileşimli olmayan ağ indiricisidir. 15 | 16 | - **GNU wget**, dosyaların Web'den etkileşimli olmayan indirilmesi için **ücretsiz** bir yardımcı programdır. **HTTP**, **HTTPS** ve **FTP** protokollerinin yanı sıra **HTTP proxy**'leri aracılığıyla alımı destekler. 17 | - `wget `etkileşimli değildir, yani kullanıcı oturum açmamışken arka planda çalışabilir. Bu, wget'in işlevini bitirmesine izin verir. Buna karşılık, Web tarayıcılarının çoğu, çok fazla veri aktarırken büyük bir engel olabilen sürekli bir kullanıcının varlığına ihtiyaç duyar. 18 | - `wget`, **HTML** ve **XHTML** sayfalarındaki bağlantıları takip edebilir ve orijinal sitenin dizin yapısını tamamen yeniden oluşturarak uzak web sitelerinin yerel sürümlerini oluşturabilir. Bu bazen **özyinelemeli** indirme olarak adlandırılır. Bunu yaparken `wget`, Robot Exclusion Standard *(Robot Hariç Tutma Standardına)* uyar. `wget`'e indirilen HTML dosyalarındaki bağlantıları çevrimdışı görüntüleme için yerel dosyalara dönüştürmesi talimatı verilebilir. 19 | - wget, yavaş veya kararsız ağ bağlantılarında **sağlamlık** için tasarlanmıştır; bir ağ sorunu nedeniyle indirme başarısız olursa, *tüm dosya alınana kadar yeniden denemeye devam eder*. Sunucu devam etmeyi destekliyorsa, sunucuya indirmeye kaldığı yerden devam etmesi talimatını verecektir. 20 | - En basit söz dizimi şu şekildedir : `wget [OPTIONS] [URL]` 21 | 22 | ## :floppy_disk: Gereksinimler 23 | Yerel makinenizde `zenity` ve `wget` kurulmuş olmalıdır. Bu kurulumları aşağıda belirtilen komut satırlarını kullanarak yapabilirsiniz. Aşağıdaki komut satırlarını çalıştırmadan önce `sudo apt-get update` komutu ile apt-get paket listelerinizi güncellemeyi unutmayınız. Bunu yapmak `wget`'in son sürümünü indirmenize imkan sunar. 24 | 25 | - `sudo apt-get install zenity` 26 | - `sudo apt-get install wget` 27 | 28 | İndirme işlemlerinin başarılı olup olmadığına terminale şu komutları yazarak emin olabilirsiniz. 29 | 30 | - `wget --version` 31 | - `zenity --version` 32 | 33 | ## :mag_right: Kurulum & Kullanım 34 | 35 | - Bir dizinde açtığınız terminalde aşağıdaki komut satırı ile repo'nun bir klonunu yerel makinenize indiriniz: 36 | -- `https://github.com/fatihes1/GUI-Bash-Script--wget.git` 37 | 38 | - Repo yerel makinenize indikten sonra `cd GUI-Bash-Script--wget` komutu ile repo dizinine giriniz. 39 | - `./script.sh` veya `bash script.sh` komutu ile program çalıştırılır. 40 | - Bu işlemden sonra program kullanıcı arayüzünde istenilen işlemler gereken gereksinimler (Dosya URL bilgisi vb. ) programa girdi olarak verilir ve program gerekli işlevleri çalıştırır. 41 | 42 | ## :framed_picture: Program Görüntüleri 43 | - Kullanıcıya sunulan seçenekler (opsiyonlar) aşağıdaki gibidir: 44 | 45 | ![01](https://user-images.githubusercontent.com/54971670/149222447-77844b5b-14b4-4580-aa13-de741ca3f0d0.PNG) 46 | 47 | - Kullanıcıdan dosya URL bilgisi gibi girdilerin alındığı pencere: 48 | 49 | ![02](https://user-images.githubusercontent.com/54971670/149222454-33a7a839-ce95-4f28-bc60-e4fd886967e8.PNG) 50 | 51 | - İndirme işleminde bir sorun oluşması durumunda ekrana gelen pencere: 52 | 53 | ![03](https://user-images.githubusercontent.com/54971670/149222455-373778b5-664c-4278-97e2-dd1df306bef5.PNG) 54 | 55 | - İndirme başarıyla tamamlandığında ekrana gelecek olan pencere: 56 | 57 | ![04](https://user-images.githubusercontent.com/54971670/149222456-e7b8c56b-7d37-4591-b359-a01c26bb3347.PNG) 58 | 59 | - Boyutu yüksek olan dosyaların indirilmesi sırasında `progresbar` penceresi , indirme tamamlanana kadar görünmektedir: 60 | 61 | ![05](https://user-images.githubusercontent.com/54971670/149222458-4216c467-4eeb-4dbb-9867-1af4fca8952c.PNG) 62 | 63 | - Kullanıcı `wget` sürümünü öğrenmek istediğinde ekrana gelen pencere: 64 | 65 | ![06](https://user-images.githubusercontent.com/54971670/149222459-e5f8c75c-464d-486d-9e36-137424a42c03.PNG) 66 | 67 | - Kullanıcı programdan çıkış yapmak istediğinde ekrana gelen pencere : 68 | 69 | ![07](https://user-images.githubusercontent.com/54971670/149222461-cce8df13-92ba-4d9c-806b-ba56ecb8a77e.PNG) 70 | -------------------------------------------------------------------------------- /script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | Status () { 3 | if [ $1 == 0 ] 4 | then 5 | zenity --info --width 500 --height 100 --title="Wget İndirme Aracı - Bilgilendirme" --text="İndirme işlemi başarıyla tamamlandı." 6 | else 7 | zenity --error --width 500 --height 100 --title="Wget İndirme Aracı - Hata" --text="İndirme işlemi sırasında bir sorun oluştu. Dosya URL bilgisinin doğru olduğundan emin olun." 8 | fi 9 | } 10 | while [ 1 ] 11 | do 12 | chosen="$(zenity --list --title="Wget Indirme Aracı" --text="Yapmak İstediğiniz İşlemi Belirtiniz" --width 1200 --height 500 --column="Eylem" --column="Açıklama" --column="Gereksinimler" \ 13 | "Normal Indirme" "Metin olarak gireceğiniz URL üzerindeki dosyanın indirilmesini sağlar." "Dosya Linki" \ 14 | "Dosya Ismiyle Indirme" "Metin olarak gireceğiniz URL üzerindeki dosyayı, belirteceğiniz spesifik dosya ismi olarak indirir." "Dosya Linki, Dosya İsmi" \ 15 | "Ozel Dizine Indirme" "Metin olarak gireceğiniz URL üzerindeki dosyayı, belirteceğiniz spesifik dizine indirme işlemi yapar." "Dosya Linki, Dizin Yolu" \ 16 | "Dosyadan Coklu Indirme" "İçerisinde URL bilgilerini tutan dosya (txt) içerisinden çoklu indirme işlemi yapar." "Dosya Linklerini İçeren text Dosyası" \ 17 | "Web Sayfasi Indirme" "Metin olarak gireceğiniz web sayfasını indirir." "Web Sayfası Linki" \ 18 | "FTP Indirme" "Parola korumalı bir FTP sunucusundan dosya indirir." "FTP Server Kullanıcı Adı, Şifresi, Dosya Linki" \ 19 | "Versiyon Ogren" "Wget versiyonunu öğrenmek için kullanılır." "Gereksinim içermez" \ 20 | "Wget Yardim" "Wget komutu hakkında yardım içeriğini gösterir." "Gereksinim içermez" \ 21 | "Cikis Yap" "Programı sonlandırmak için kullanılır." "Gereksinim içermez")" 22 | 23 | if [ $? != 0 ] 24 | then 25 | exit 1 26 | fi 27 | 28 | if [ "$chosen" == "Normal Indirme" ] 29 | then 30 | input="$(zenity --entry --title="Normal İndirme" --width 800 --text="İndirmek istediğiniz dosyanın URL bilgisini giriniz.")" 31 | wget $input | zenity --progress --title="Wget Inderme Aracı - İndiriliyor" --text="Dosya(lar) İndiriliyor" --width 600 --auto-close --pulsate --no-cancel 32 | Status ${PIPESTATUS[0]} 33 | elif [ "$chosen" == "Dosya Ismiyle Indirme" ] 34 | then 35 | input="$(zenity --entry --title="Dosya İsmiyle İndirme" --width 800 --text="İndirmek istediğiniz dosyanın URL bilgisini giriniz.")" 36 | file="$(zenity --entry --title="Dosya İsmiyle İndirme" --width 800 --text="İndirilecek dosyaya vermek istediğiniz ismi giriniz.")" 37 | wget -O $file $input | zenity --progress --title="Wget Inderme Aracı - İndiriliyor" --text="Dosya(lar) İndiriliyor" --width 600 --auto-close --pulsate --no-cancel 38 | Status ${PIPESTATUS[0]} 39 | elif [ "$chosen" == "Ozel Dizine Indirme" ] 40 | then 41 | input="$(zenity --entry --title="Özel Dizine İndirme" --width 800 --text="İndirmek istediğiniz dosyanın URL bilgisini giriniz.")" 42 | directory="$(zenity --file-selection --title="İndirilecek Dizini Seçiniz" --directory)" 43 | wget -P $directory $input | zenity --progress --title="Wget Inderme Aracı - İndiriliyor" --text="Dosya(lar) İndiriliyor" --width 600 --auto-close --pulsate --no-cancel 44 | Status ${PIPESTATUS[0]} 45 | elif [ "$chosen" == "Dosyadan Coklu Indirme" ] 46 | then 47 | input=`zenity --file-selection --title="Linkleri İçeren Dosyayı Seçiniz"` 48 | wget -i "$input" | zenity --progress --title="Wget Inderme Aracı - İndiriliyor" --text="Dosya(lar) İndiriliyor" --width 600 --auto-close --pulsate --no-cancel 49 | Status ${PIPESTATUS[0]} 50 | elif [ "$chosen" == "Web Sayfasi Indirme" ] 51 | then 52 | input="$(zenity --entry --title="Web Sayfası İndirme" --width 800 --text="İndirmek istediğiniz web sayfasının URL bilgisini giriniz.")" 53 | zenity --info --width 500 --height 100 --title="Wget İndirme Aracı - Bilgilendirme" --text="Bu işlem web sayfasının büyüklüğüne göre değişkenlik sağlayabilir. Lütfen bekleyiniz. İndirme işlemi bittiğinde bildirileceksiniz." 54 | wget -m $input | zenity --progress --title="Wget Inderme Aracı - İndiriliyor" --text="Dosya(lar) İndiriliyor" --width 600 --auto-close --pulsate --no-cancel 55 | Status ${PIPESTATUS[0]} 56 | elif [ "$chosen" == "FTP Indirme" ] 57 | then 58 | username="$(zenity --entry --title="Web Sayfası İndirme" --width 800 --text="FTP Server Kullanıcı Adınızı Giriniz")" 59 | password="$(zenity --entry --title="Web Sayfası İndirme" --width 800 --text="FTP Server Kullanıcı Parolanızı Giriniz")" 60 | input="$(zenity --entry --title="Web Sayfası İndirme" --width 800 --text="İndirmek istediğiniz dosyanın URL bilgisini giriniz.")" 61 | wget --ftp-user=$username --ftp-password=$password $input | zenity --progress --title="Wget Inderme Aracı - İndiriliyor" --text="Dosya(lar) İndiriliyor" --width 600 --auto-close --pulsate --no-cancel 62 | Status ${PIPESTATUS[0]} 63 | elif [ "$chosen" == "Versiyon Ogren" ] 64 | then 65 | version=$(wget --version | head -1) 66 | zenity --info --width 500 --height 100 --title="Wget İndirme Aracı - Bilgilendirme" --text="Kullandığınız wget versiyonu : ${version}" 67 | elif [ "$chosen" == "Wget Yardim" ] 68 | then 69 | version=$(wget --help) 70 | echo $version > help.txt 71 | FILE=help.txt 72 | zenity --text-info --width 800 --height 600 --title="Wget İndirme Aracı - Yardım" --filename=$FILE 73 | elif [ "$chosen" == "Cikis Yap" ] 74 | then 75 | zenity --question --text "Çıkış yapmak istediğinize emin misiniz?" --width 500 --height 80 --ok-label "Evet" --cancel-label="Hayır" 76 | if [ $? == 0 ] 77 | then 78 | break 79 | fi 80 | fi 81 | done 82 | -------------------------------------------------------------------------------- /url_links.txt: -------------------------------------------------------------------------------- 1 | http://ekampus.btu.edu.tr/pluginfile.php/245503/mod_resource/content/1/Shell_scripting-1.pdf 2 | http://ekampus.btu.edu.tr/pluginfile.php/245505/mod_resource/content/1/Shell_scripting-2.pdf 3 | http://ekampus.btu.edu.tr/pluginfile.php/245508/mod_resource/content/1/Shell_scripting-3.pdf 4 | http://ekampus.btu.edu.tr/pluginfile.php/245509/mod_resource/content/1/Shell_scripting-4.pdf --------------------------------------------------------------------------------