mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-10-01 09:40:35 +13:00
Update linux installer script
This commit is contained in:
parent
1b1d388941
commit
c58ad29309
1 changed files with 13 additions and 27 deletions
38
get-xpipe.sh
38
get-xpipe.sh
|
@ -95,31 +95,6 @@ parse_os_name() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
uninstall() {
|
|
||||||
local uname_str="$(uname -s)"
|
|
||||||
case "$uname_str" in
|
|
||||||
Linux)
|
|
||||||
if [ -d "/opt/$kebap_product_name" ]; then
|
|
||||||
info "Uninstalling previous version"
|
|
||||||
if [ -f "/etc/debian_version" ]; then
|
|
||||||
DEBIAN_FRONTEND=noninteractive sudo apt-get remove -qy "$kebap_product_name"
|
|
||||||
else
|
|
||||||
sudo rpm -e "$kebap_product_name"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
Darwin)
|
|
||||||
if [ -d "/Applications/$product_name.app" ]; then
|
|
||||||
info "Uninstalling previous version"
|
|
||||||
sudo "/Applications/$product_name.app/Contents/Resources/scripts/uninstall.sh"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
local uname_str="$(uname -s)"
|
local uname_str="$(uname -s)"
|
||||||
local file="$1"
|
local file="$1"
|
||||||
|
@ -128,7 +103,19 @@ install() {
|
||||||
Linux)
|
Linux)
|
||||||
if [ -f "/etc/debian_version" ]; then
|
if [ -f "/etc/debian_version" ]; then
|
||||||
info "Installing file $file with apt"
|
info "Installing file $file with apt"
|
||||||
|
sudo apt update
|
||||||
DEBIAN_FRONTEND=noninteractive sudo apt install -qy "$file"
|
DEBIAN_FRONTEND=noninteractive sudo apt install -qy "$file"
|
||||||
|
elif [ -x "$(command -v zypper)" ]; then
|
||||||
|
info "Installing file $file with zypper"
|
||||||
|
sudo zypper refresh
|
||||||
|
sudo zypper install -y "$file"
|
||||||
|
elif [ -x "$(command -v dnf)" ]; then
|
||||||
|
info "Installing file $file with dnf"
|
||||||
|
sudo dnf install -y --refresh "$file"
|
||||||
|
elif [ -x "$(command -v yum)" ]; then
|
||||||
|
info "Installing file $file with yum"
|
||||||
|
sudo yum clean expire-cache
|
||||||
|
sudo yum install -y "$file"
|
||||||
else
|
else
|
||||||
info "Installing file $file with rpm"
|
info "Installing file $file with rpm"
|
||||||
sudo rpm -i "$file"
|
sudo rpm -i "$file"
|
||||||
|
@ -249,7 +236,6 @@ if [ "$exit_status" != 0 ]; then
|
||||||
exit "$exit_status"
|
exit "$exit_status"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
uninstall
|
|
||||||
install "$download_archive"
|
install "$download_archive"
|
||||||
|
|
||||||
exit_status="$?"
|
exit_status="$?"
|
||||||
|
|
Loading…
Reference in a new issue