From 999a7fd164608f24979a614f3cf49574e8c5be6f Mon Sep 17 00:00:00 2001 From: Conan_Doyl Date: Mon, 6 Jul 2020 13:27:25 +0200 Subject: [PATCH] init --- nextcloud_head.sh | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 nextcloud_head.sh diff --git a/nextcloud_head.sh b/nextcloud_head.sh new file mode 100644 index 0000000..0e68857 --- /dev/null +++ b/nextcloud_head.sh @@ -0,0 +1,122 @@ +#!/bin/bash +# ############################################################################### +# File: nextcloud_head.sh +# Project: SH Scripts +# File Created: Monday, 6th July 2020 11:05:48 am +# Author: Thomas Brinkmann (doyl@dsh.icu) +# ----- +# Last Modified: Monday, 6th July 2020 1:25:29 pm +# Modified By: Thomas Brinkmann (doyl@dsh.icu>) +# ----- +# Copyright 2020 - Thomas Brinkmann. All Rights Reserved. +# ----- +# License Text +# Es ist Ihnen untersagt diese Software zu kopieren, manipulieren, verbreiten oder anderweitig ohne ausdrückliche Erlaubnis zu nutzen. +# Sie dürfen ebenfalls nicht den Copyright Hinweis entfernen. +# +# It is prohibited to copy, manipulate, distribute or otherwise use this software without express permission. +# You may also not remove the copyright notice. +# ----- +# ############################################################################### + + + +VAR_A=`uname -m` + +show_spinner() +{ + spin='-\|/' + + i=0 + while kill -0 $1 2>/dev/null + do + i=$(( (i+1) %4 )) + printf "\r[ \e[36m${spin:$i:1} \e[93m] \e[93mWaiting for another process to finish..." + sleep .1 + done +} + + + +i=0 +tput sc +while fuser /var/{lib/{dpkg,apt/lists},cache/apt/archives}/lock >/dev/null 2>&1 ; do + case $(($i % 4)) in + 0 ) j="-" ;; + 1 ) j="\\" ;; + 2 ) j="|" ;; + 3 ) j="/" ;; + esac + tput rc + echo -en "\r[$j] \e[93mWaiting for other software managers to finish..." + sleep 0.5 + ((i=i+1)) +done + +echo -e "\n\e[92mPackage manager is done" +echo -e "\e[36mPreparing Nextcloud installation.." +echo -e "\e[36mChecking Operation system.." + + +# CHECK OS +if [ "$VAR_A" = "x86_64" ]; then + check=`cat /etc/issue | grep -i 'Debian'` + if [ -n "$check" ]; then + apt-get update >/dev/null & + show_spinner $! + version=`cat /etc/debian_version | awk -F. '{print $1}'` + + if [ $version -eq 10 ]; then + #Debian 10 + echo -e "\nDebian $version" + + elif [ $version -eq 9 ]; then + #Debian 9 Check + echo -e "\nDebian $version" + + elif [ $version -eq 8 ]; then + #Debian 8 Check + echo "Debian $version" + + + fi + fi + #Debian Check End + + + #Ubuntu + check=`cat /etc/issue | grep -i 'Ubuntu'` + if [ -n "$check" ]; then + apt-get update >/dev/null & + show_spinner $! + version=`lsb_release -sr | awk -F. '{print $1}'` + if [ $version -eq 20 ]; then + #Ubuntu 20 + echo "Ubuntu $version" + + elif [ $version -eq 18 ]; then + #Ubuntu 18 + echo "Ubuntu $version" + + elif [ $version -eq 16 ]; then + #Ubuntu 16 + echo "Ubuntu $version" + + fi + + + fi + + + #CentOS + check=`cat /etc/issue | grep -i 'CentOS'` + if [ -n "$check" ]; then + echo "CentOS is not supported yet" + fi + + +fi + + + +echo -e "\e[39mEverything is done." \ No newline at end of file