AlexLeo

Eclipse Install v1

May 2nd, 2015
501
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. desktopPathL1="/usr/share"
  4. desktopPathL2="/usr/share/applications"
  5.  
  6. echo "大家好,我是小獅! "
  7. echo "接下來要帶大家安裝 Eclipse 喔! "
  8. read -p "請選擇版本 [32/64]: " ver  # 提示使用者輸入
  9.  
  10. if [ "$ver" = "32" ] || [ "$ver" = "x32" ]; then
  11.     echo "下載 Eclipse Luna SR2 x86"
  12.     wget "https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/luna/SR2/eclipse-java-luna-SR2-linux-gtk.tar.gz&r=1" -O ~/eclipse-java-luna-SR2-linux-gtk.tar.gz
  13.     echo "解壓縮 Eclipse Luna SR2 x86"
  14.     tar -xvf ~/eclipse-java-luna-SR2-linux-gtk.tar.gz -C /opt/
  15.     echo "建立捷徑"
  16.     [ -d $desktopPathL1 ] || mkdir $desktopPathL1
  17.     [ -d $desktopPathL2 ] || mkdir $desktopPathL2
  18.     echo "[Desktop Entry]" > /usr/share/applications/eclipse.desktop
  19.     echo "Name=Eclipse 4" > /usr/share/applications/eclipse.desktop
  20.     echo "Type=Application" > /usr/share/applications/eclipse.desktop
  21.     echo "Exec=/opt/eclipse/eclipse" > /usr/share/applications/eclipse.desktop
  22.     echo "Terminal=false" > /usr/share/applications/eclipse.desktop
  23.     echo "Icon=/opt/eclipse/icon.xpm" > /usr/share/applications/eclipse.desktop
  24.     echo "Comment=Integrated Development Environment" > /usr/share/applications/eclipse.desktop
  25.     echo "NoDisplay=false" > /usr/share/applications/eclipse.desktop
  26.     echo "Categories=Development;IDE;" > /usr/share/applications/eclipse.desktop
  27.     echo "Name[en]=Eclipse" > /usr/share/applications/eclipse.desktop
  28.     echo "刪除壓縮檔"
  29.     rm  ~/eclipse-java-luna-SR2-linux-gtk.tar.gz
  30.     exit 0
  31.    
  32. elif [ "$ver" = "64" ] || [ "$ver" = "x64" ]; then
  33.     echo "下載 Eclipse Luna SR2 x86_64"
  34.     wget "https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/luna/SR2/eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz&r=1" -O ~/eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz
  35.     echo "解壓縮 Eclipse Luna SR2 x86_64"
  36.     tar -xvf ~/eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz -C /opt/
  37.     echo "建立捷徑"
  38.     [ -d $desktopPathL1 ] || mkdir $desktopPathL1
  39.     [ -d $desktopPathL2 ] || mkdir $desktopPathL2
  40.     echo "[Desktop Entry]" > /usr/share/applications/eclipse.desktop
  41.     echo "Name=Eclipse 4" > /usr/share/applications/eclipse.desktop
  42.     echo "Type=Application" > /usr/share/applications/eclipse.desktop
  43.     echo "Exec=/opt/eclipse/eclipse" > /usr/share/applications/eclipse.desktop
  44.     echo "Terminal=false" > /usr/share/applications/eclipse.desktop
  45.     echo "Icon=/opt/eclipse/icon.xpm" > /usr/share/applications/eclipse.desktop
  46.     echo "Comment=Integrated Development Environment" > /usr/share/applications/eclipse.desktop
  47.     echo "NoDisplay=false" > /usr/share/applications/eclipse.desktop
  48.     echo "Categories=Development;IDE;" > /usr/share/applications/eclipse.desktop
  49.     echo "Name[en]=Eclipse" > /usr/share/applications/eclipse.desktop
  50.     echo "刪除壓縮檔"
  51.     rm  ~/eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz
  52.     exit 0
  53.    
  54. else
  55.     echo "我聽不懂耶~" && exit 0
  56. fi
RAW Paste Data