Remove obsolete scripts

This commit is contained in:
mollusk 2020-07-08 23:36:47 -07:00
parent f419fbf5b3
commit f55fa43175
10 changed files with 0 additions and 643 deletions

View File

@ -1,19 +0,0 @@
#!/bin/bash
testingpoo(){
if [ $1 -gt $2 ];then
echo "$1 is greater than $2"
elif [ $1 -lt $2 ];then
echo "$1 is less than $2"
elif [ $1 -eq $2 ];then
echo "$1 is equal to $2"
else
echo "Fuck you"
fi
}
testingpoo $1 $2

View File

@ -1,36 +0,0 @@
#!/bin/bash
appname="LBRY"
version="0.15.0"
arch="amd64"
url="https://github.com/lbryio/lbry-app/releases/download/v${version}/${appname}_${version}_${arch}.deb"
depends="gnome-keyring nodejs npm binutils xz"
tmpdir="/tmp"
output_file="lbry.deb"
desc="Content distribution platform using blockchain technology"
fetch_deps(){
sudo dnf install ${depends}
}
fetch_url(){
if [ ! -f ${tmpdir}/${output_file} ];then
wget -O ${tmpdir}/${output_file} ${url}
fi
}
extract_file(){
cd ${tmpdir}
sudo ar x ${output_file} data.tar.xz
sudo tar xvf data.tar.xz
}
install(){
sudo cp -rv ${tmpdir}/usr/* /usr/
sudo cp -rv ${tmpdir}/opt/* /opt/
}
fetch_deps
fetch_url
extract_file
install

View File

@ -1,56 +0,0 @@
#!/bin/bash
GITBUCKETPATH="/home/mollusk/.gitbucket"
WARFILE="gitbucket.war"
LIBNOTIFY="true"
LOGDIR="/tmp"
LOGFILE="gitbucket.log"
CheckNotify()
{
if [ "${LIBNOTIFY}" = "true" ];then
notify-send "$1"
elif [ "${LIBNOTIFY}" = "false" ];then
"$1" &> /dev/null
echo "$(date +"%T"): [INFO]: libnotify support disabled" >> ${LOGDIR}/${LOGFILE}
else
echo "[ATTENTION]: Please check the logs: /tmp/gitbucket.log"
echo "$(date +"%T"): [WARNING]: LIBNOTIFY setting is invalid" >> ${LOGDIR}/${LOGFILE}
fi
}
case "$1" in
start) nohup java -jar ${GITBUCKETPATH}/${WARFILE} &> /dev/null &
sleep 1
PID=$(pidof java)
if [ "${PID}" ];then
CheckNotify "Gitbucket started on PID: ${PID}"
echo "Gitbucket started on PID: ${PID}"
else
CheckNotify "Gitbucket Failed to start!"
echo "Gitbucket process failed to start!"
fi
;;
stop) killall java
sleep 1
if [ ! "${PID}" ];then
CheckNotify "Gitbucket was terminated"
echo "Gitbucket was terminated"
else
CheckNotify "There was a problem terminating Gitbucket"
echo "There was a problem terminating Gitbucket"
fi
;;
open) xdg-open "http://localhost:8080" &> /dev/null
;;
status) ps -fC java
;;
esac

112
goup.sh
View File

@ -1,112 +0,0 @@
#!/bin/bash
case ${1} in
--set-version)
version="${2}"
;;
*)
pkgname="go"
version="1.9.1"
distfile="https://storage.googleapis.com/golang/${pkgname}${version}.linux-amd64.tar.gz"
tmpdir="/tmp"
installdir="/usr/local"
checksum=d70eadefce8e160638a9a6db97f7192d8463069ab33138893ad3bf31b0650a79
# Colors
RED='\033[0;31m'
LRED="\033[1;31m"
BLUE="\033[0;34m"
LBLUE="\033[1;34m"
GREEN="\033[0;32m"
LGREEN="\033[1;32m"
YELLOW="\033[1;33m"
CYAN="\033[0;36m"
LCYAN="\033[1;36m"
PURPLE="\033[0;35m"
LPURPLE="\033[1;35m"
BWHITE="\e[1m"
NC='\033[0m' # No Color
fetch_(){
printf "${BWHITE}\nFetching file\n${NC}"
cd ${tmpdir}
if [ ! -f ${pkgname}${version}.linux-amd64.tar.gz ];then
wget ${distfile}
fi
printf "${BWHITE}\nVerifying checksum\n${NC}"
if [ ! -f checksum.txt ];then
echo "${checksum} ${pkgname}${version}.linux-amd64.tar.gz" >> checksum.txt
sha256sum -c checksum.txt
else
sha256sum -c checksum.txt
fi
if [ $? = 1 ];then
exit 0;
fi
}
extract-install_(){
cd ${tmpdir}
if [ ! -f ${pkgname}${version}.linux-amd64.tar.gz ];then
echo "No file found to extract"
else
printf "${BWHITE}\nExtracting and installing to:${NC} " && printf "${LCYAN}${installdir}\n${NC}"
printf "${LRED}\nAuthentication for root:${NC}\n" && su -c "tar -C ${installdir} -xzvf ${pkgname}${version}.linux-amd64.tar.gz"
fi
if [ ! -d /usr/local/go ];then
echo -e "\nCan not find ${pkgname} in ${installdir}\n"
exit 0;
else
echo -e "${LGREEN}\n${pkgname}-${version} has been installed to ${installdir}${NC}"
fi
}
add-path_(){
echo -e "\n1. Add gopath to ${HOME}/.profile\n"
echo -e "\n2. Add gopath to ${HOME}/.bashrc\n"
read choice
if [ "${choice}" = "1" ];then
echo 'export PATH=$PATH:/usr/local/go/bin' >> ${HOME}/.profile
elif [ "${choice}" = "2" ];then
printf "${BWHITE}\nAdding gopath to .bashrc${NC}"
echo 'export PATH=$PATH:/usr/local/go/bin' >> ${HOME}/.bashrc
catpath=$(cat ${HOME}/.bashrc | grep /usr/local/go/bin)
${catpath}
if [ $? = 1 ];then
printf "${BWHITE}\n\nRunning grep on .bashrc\n\n${NC}"
printf "${LCYAN}Grep Results:${NC} ${LGREEN}${catpath}\n\n${NC}"
printf "${YELLOW}Please edit: ${HOME}/.bashrc:${NC}\n\n"
printf "${YELLOW}Above are results for grep on .bashrc, if nothing is there then please add:\n\n${NC}${BWHITE}"
echo -e 'export PATH=$PATH:/usr/local/go/bin' && printf "\n\n${NC}"
else
printf "${LGREEN}\n\ngo has been added to your path in ${HOME}/.bashrc\n\n${NC}"
fi
fi
}
fetch_
extract-install_
add-path_
;;
--help | -h)
printf "${BWHITE}\nUseage ${0} [options] [arguments]\n\n${NC}"
printf "--set-version enter in an existing go version to download\n"
printf "--help, -help Display this help page"
;;
esac

View File

@ -1,50 +0,0 @@
#!/bin/bash
URL="https://wire-app.wire.com/linux/wire_2.12.2729_amd64.deb"
# Colors
RED='\033[0;31m'
LRED="\033[1;31m"
BLUE="\033[0;34m"
LBLUE="\033[1;34m"
GREEN="\033[0;32m"
LGREEN="\033[1;32m"
YELLOW="\033[1;33m"
CYAN="\033[0;36m"
LCYAN="\033[1;36m"
PURPLE="\033[0;35m"
LPURPLE="\033[1;35m"
BWHITE="\e[1m"
NC='\033[0m' # No Color
checkDeps()
{
if [ ! -f /usr/bin/gdebi ];then
printf "${LBLUE}Downloading dependencies..${NC}\n"
sudo apt update
sudo apt-get -y install gdebi
if [ ! -f /usr/bin/gdebi ];then
printf "${LRED}gdebi could not be found, I installed it but it's not there${NC}\n"
printf "${LRED}I normally use gdebi to install individual packages${NC}\n"
exit 0;
fi
fi
}
getWire()
{
printf "${LBLUE}Downloading wire...${NC}\n"
wget ${URL}
printf "${LCYAN}Installing Wire...${NC}\n"
sudo gdebi -n wire_2.12.2729_amd64.deb
}
checkDeps
getWire

View File

@ -1,8 +0,0 @@
#!/bin/bash
pkglist="usbutils pcmanfm net-tools gmusicbrowser pianobar chromium
deluge chromium-pepper-flash gcc-c++ mlocate gvfs ntfs-3g
atom terminator alsa-utils xfce4-whiskermenu-plugin playonlinux"
tux i void-repo-nonfree void-repo-multilib
tux i ${pkglist}

View File

@ -1,12 +0,0 @@
#!/bin/bash
xbps-install -Su
if [ $? = 0 ];then
echo "Success!"
elif [ $? = 1 ];then
echo "Nothing to see here"
fi

View File

@ -1,126 +0,0 @@
#!/bin/bash
# Name : telegram-installer.sh
############################################################################
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
############################################################################
URL="https://tdesktop.com/linux"
FILE="tsetup.tar.xz"
OUTDIR="${HOME}/.telegram/bin"
SYMDIR="/usr/bin"
#check and create directories
checkDir(){
if [ ! -d ${OUTDIR} ];then
mkdir -v -p ${OUTDIR}
if [ ! -d ${OUTDIR} ];then
echo "The directory '${OUTDIR}' could not be created"
return false
fi
else
return 0
fi
}
askOpen(){
echo -n "Do you want to run telegram now?[y/n]"
read runNow
if [ "${runNow}" = "y" ];then
${OUTDIR}/Telegram/Telegram
else
return 1
fi
}
createSym(){
echo -n "Do you want to create a symlink to ${SYMDIR}?[y/n](requires root): "
read symchoice
if [ ${symchoice} = "n" ];then
return 1
else
sudo ln -s -v ${OUTDIR}/Telegram/Telegram ${SYMDIR}/telegram
fi
}
chkInstall(){
if [ -d ~/.telegram ];then
echo
echo -n "Telegram is already installed, would you like to uninstall it?[y/n]: "
read choice
if [ "${choice}" = "y" ];then
echo
echo "Removing symlink from ${SYNDIR}..."
sudo rm /usr/bin/telegram
echo
echo "Removing ${OUTDIR}..."
echo
rm -r -v ~/.telegram
if [ ! -d ~/.telegram ];then
echo
echo "Telegram is uninstalled"
exit 0;
else
echo
echo "Telegram is still installed, please remove it manually"
fi
else
echo
echo "Skipping removal"
exit 0;
fi
else
echo
echo "Telegram is not installed"
fi
}
#Pull everything together
main(){
chkInstall
checkDir
if [ ! checkDir ];then
echo "Looks like something went wrong creating the directory"
else
if [ ! -f /tmp/${FILE} ];then
wget -O /tmp/${FILE} ${URL}
tar xvf /tmp/${FILE} -C ${OUTDIR}
echo
createSym
askOpen
elif [ -f /tmp/${FILE} ];then
tar xvf /tmp/${FILE} -C ${OUTDIR}
echo
createSym
askOpen
else
echo "Looks like the file does not exist"
echo "Check your internet connection and system permissions"
return false
fi
fi
}
main

60
uppy.sh
View File

@ -1,60 +0,0 @@
#!/bin/bash
CONFIG="~/config/.uppy.conf"
# Colors
RED='\033[0;31m'
LRED="\033[1;31m"
BLUE="\033[0;34m"
LBLUE="\033[1;34m"
GREEN="\033[0;32m"
LGREEN="\033[1;32m"
YELLOW="\033[1;33m"
CYAN="\033[0;36m"
LCYAN="\033[1;36m"
PURPLE="\033[0;35m"
LPURPLE="\033[1;35m"
BWHITE="\e[1m"
NC='\033[0m' # No Color
if [ ! -f /usr/bin/apt ];then
echo -e "${LRED}Apt is missing!..exiting!${NC}\n"
exit 1
fi
if [ ! -f ${CONFIG} ];then
echo -e "${LBLUE}Creating config in ${CONFIG}${NC}\n"
touch ${CONFIG}
fi
if grep -Fxq "AUTOCONFIRM='true'" ${CONFIG};then
AUTO="yes"
else
echo -n "Do you want to skip confirmations?[n/Y]"
read confirm
if [ "${confirm}" = "y" ];then
echo "AUTOCONFIRM='true'" > ${CONFIG}
fi
fi
echo -e "${LBLUE}Checking Sources...${NC}\n"
sudo apt update
echo -e "${LBLUE}Starting Upgrade...${NC}\n"
if [ "${AUTO}" = "yes" ];then
sudo apt -y upgrade
else
sudo apt upgrade
fi

View File

@ -1,164 +0,0 @@
#!/bin/bash
APP="wire-desktop"
NPM_DIR="/usr/bin/npm"
BIN_DIR="/home/${USER}/wire-packages"
PACKAGE_DEFAULT_DIR="$(pwd)/wrap/dist"
SUPER_USER_CMD="sudo"
REPO_URL="https://github.com/wireapp/${APP}.git"
# Colors
RED='\033[0;31m'
LRED="\033[1;31m"
BLUE="\033[0;34m"
LBLUE="\033[1;34m"
GREEN="\033[0;32m"
LGREEN="\033[1;32m"
YELLOW="\033[1;33m"
CYAN="\033[0;36m"
LCYAN="\033[1;36m"
PURPLE="\033[0;35m"
LPURPLE="\033[1;35m"
BWHITE="\e[1m"
NC='\033[0m' # No Color
if [[ $EUID -eq 0 ]]; then
printf "${LRED}Do not run this script as root${NC}\n" 1>&2
exit 1
fi
check_repo(){
if [ ! -d ${APP} ];then
git clone ${REPO_URL}
elif [ -d .git ];then
printf "\n${LRED}This is already a Git repository!${NC}\n"
fi
}
check_sudo(){
if [ ! -f /usr/bin/sudo ];then
SUPER_USER_CMD="su -c"
fi
}
apt_install(){
local PACKAGES="git make nodejs npm"
printf "${LCYAN}Fetching dependencies${NC}\n\n"
${SUPER_USER_CMD} apt install ${PACKAGES}
}
dnf_install(){
local PACKAGES='rpm-build rpmdevtools make nodejs npm nss libXScrnSaver git'
printf "${LCYAN}Fetching dependencies${NC}\n\n"
${SUPER_USER_CMD} dnf install ${PACKAGES}
}
zypper_install(){
local PACKAGES="make git nodejs npm"
printf "${LCYAN}Fetching dependencies${NC}\n\n"
${SUPER_USER_CMD} 'zypper install "${PACKAGES}"'
}
check_deps(){
declare -a FIND_PACKAGE_MANAGER=(
"apt"
"dnf"
"zypper")
for i in ${FIND_PACKAGE_MANAGER[@]};do
PACKAGE_MANAGER=$(which ${i} 2> /dev/null)
echo "$PACKAGE_MANAGER"
if [ -n "${PACKAGE_MANAGER}" ];then
break
fi
done
if [[ "${PACKAGE_MANAGER}" = "/usr/bin/apt" ]];then
apt_install
elif [ "${PACKAGE_MANAGER}" = "/usr/bin/dnf" ];then
dnf_install
elif [[ "${PACKAGE_MANAGER}" = "/usr/bin/xbps-install" ]];then
xbps_install
elif [[ "${PACKAGE_MANAGER}" = "/usr/bin/zypper" ]];then
zypper_install
fi
}
build_deb(){
local ARCH="x64"
local TARGET="deb"
local UPDATE_OPTS="'clean:linux' 'update-keys' 'release-prod'"
local BUILD_OPTS="--arch=${ARCH} --target=${TARGET} 'electronbuilder:linux_other'"
npm install
npm update
sudo npm install -g grunt
sudo grunt 'clean:linux' 'update-keys' 'release-prod' 'bundle'
sudo grunt --arch=${ARCH} --target=${TARGET} 'electronbuilder:linux_other'
sudo mv -v ${PACKAGE_DEFAULT_DIR}/*.${TARGET} ${BIN_DIR}
}
build_rpm(){
local ARCH="x64"
local TARGET="rpm"
local UPDATE_OPTS="'clean:linux' 'update-keys' 'release-prod'"
local BUILD_OPTS="--arch=${ARCH} --target=${TARGET} 'electronbuilder:linux_other'"
npm install
npm update
npm install grunt
grunt 'clean:linux' 'update-keys' 'release-prod'
grunt --arch=${ARCH} --target=${TARGET} 'electronbuilder:linux_other'
mv -v ${PACKAGE_DEFAULT_DIR}/*.${TARGET} ${BIN_DIR}
}
git_pull(){
if [ -d .git ];then
git stash
git pull origin master
fi
}
main(){
if [ ! -d ${BIN_DIR} ];then
mkdir -pv ${BIN_DIR}
fi
case $1 in
all | -a) check_deps && git_pull && build_rpm && build_deb
;;
deb | -d) git_pull && build_deb
;;
rpm | -r) check_deps && git_pull && build_rpm
;;
clone | -c) check_repo
;;
*)
printf "\n\n"
printf "Usage: $0 [-a/all | -d/deb | -r/rpm ]\n\n"
printf " -a | all build all package formats\n"
printf " -d | deb build only DEB package format\n"
printf " -r | rpm build only RPM package format\n"
printf " -c | clone clone 'wire-desktop' from Github\n\n"
;;
esac
}
main ${1}