milis/bin/komutan-kur

45 lines
678 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
paketdepo="/var/lib/pkg/DB"
depo="https://notabug.org/milisarge/komutan"
kuryer="/opt/komutan-0"
elixir_hata(){
echo "elixir kurulamadı. Tekrar deneyiniz."
exit 1
}
git_hata(){
echo "komutan indirilemedi. Tekrar deneyiniz"
exit 1
}
komutan_gerekler(){
sudo mix local.rebar --force
sudo mix local.hex --force
sudo mix deps.get
}
komutan_kur(){
cd ${kuryer}
komutan_gerekler
}
if [ ! -d ${paketdepo}/elixir ];then
mps guncelle && mps kur elixir
fi
[ ! -d ${paketdepo}/elixir ] && elixir_hata
if [ -d ${kuryer} ];then
cd ${kuryer} && sudo git pull
else
sudo git clone ${depo} ${kuryer}
fi
if [ -d ${kuryer} ];then
komutan_kur
else
git_hata
fi