initial commit

This commit is contained in:
a-sansara 2017-07-07 02:39:42 +02:00
commit e3e0ab7522
3 changed files with 52 additions and 0 deletions

4
README.md Normal file
View File

@ -0,0 +1,4 @@
bes-install
===========
bes-install is a simple bash bes install library

13
bes.ini Normal file
View File

@ -0,0 +1,13 @@
[project]
vendor = bes
name = install
version = 1.0
license = "GNU GPL v3"
author = a-Sansara
type = library
homepage = "https://git.pluie.org/meta-tech/bes-install"
description = "simple bash bes installer"
keywords = "bash, bes, install"
[require]
bes.echo = 1.1

35
src/install.sh Normal file
View File

@ -0,0 +1,35 @@
#!/bin/bash
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# @author a-Sansara - https://git.pluie.org/meta-tech/bes-install
# @app bes-install
# @license GNU GPL v3
# @date 2017-07-07 02:21:51 CET
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function bes.install ()
{
local app=${1}
local url=${2}
local path=${3:-/usr/local/bin}
local done=1
bes.echo.title "Installing $app ${Coff}in" "$path"
if [ -f "./$app" ]; then
rm ./$app
fi
wget -q $url
if [ $? -eq 0 ]; then
chmod +x ./$app
if [ -d $path ]; then
sudo mv ./$app $path/$app
local done=$?
bes.echo.state $done
else
bes.echo.error "install directory do not exists : ${Cspe}$path"
fi
else
bes.echo.error "can not download latest version of app $app. please check url : $url"
fi
bes.echo.rs $done
}