-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall-lando_ubuntu.sh
executable file
·30 lines (28 loc) · 1.1 KB
/
install-lando_ubuntu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
latest=$(curl --silent "https://api.github.com/repos/lando/lando/releases" | grep -Po '"tag_name": "\K.*?(?=")' | head -n1)
package_name="lando.deb"
if ls $HOME/Downloads/lando* 1> /dev/null 2>&1; then
echo -e "lando Package exists\n"
else
echo -e "lando doesn't Exist >>>>> Downloading \n"
cd ~/Downloads && { curl -L -o $package_name https://github.com/lando/lando/releases/download/$latest/lando-$latest.deb; cd -; }
fi
if [ $(dpkg-query -W -f='${Status}' lando 2>/dev/null | grep -c "install ok installed") -eq 0 ];
then
sudo dpkg -i ~/Downloads/lando*
sudo apt-get -y -qq -f install
else
echo -e "lando $(lando version) Already Installed\n"
current=$(lando version)
echo -e "Checking if it can be updated\n"
if [ $current != $latest ]
then
rm -rf $HOME/Downloads/lando*
cd ~/Downloads && { curl -L -o $package_name https://github.com/lando/lando/releases/download/$latest/lando-$latest.deb; cd -; }
sudo dpkg -i ~/Downloads/lando*
sudo apt-get -y -qq -f install
echo -e "Updated lando to $(lando version)\n"
else
echo -e "No Update Found!\n"
fi
fi