standardize script beginning

pull/20/head
Botspot 5 years ago
parent e69f8910a7
commit dc3329b952

@ -1,7 +1,9 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}

@ -1,15 +1,14 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
# Get dependencies
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
rm -f ./balena-etcher-electron_1.5.63_Raspbian_Buster_armhf.deb
# Get dependencies
wget https://github.com/futurejones/balena-etcher-arm/releases/download/v1.5.63/balena-etcher-electron_1.5.63_Raspbian_Buster_armhf.deb
sudo apt install -y ./balena-etcher-electron_1.5.63_Raspbian_Buster_armhf.deb || error "failed to install deb file!"

@ -1,10 +1,10 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
sudo apt purge -y balena-etcher-electron || error "failed to purge the deb file!"

@ -1,7 +1,9 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}

@ -1,7 +1,9 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}

@ -1,12 +1,13 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
# Get dependencies
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
"${DIRECTORY}/pkg-install" "python3-tk python3-pil python3-pil.imagetk" "$(dirname "$0")" || exit 1
git clone https://github.com/Jack477/CommanderPi || error "failed to download repository!"

@ -1,11 +1,11 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
"${DIRECTORY}/purge-installed" "$(dirname "$0")" || exit 1
rm -rf ~/CommanderPi || error "failed to remove commanderpi folder!"

@ -1,8 +1,9 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}

@ -1,8 +1,9 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}

@ -1,12 +1,12 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
# Get dependencies
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
"${DIRECTORY}/pkg-install" "build-essential qmlscene qt5-qmake qt5-default qtdeclarative5-dev qml-module-qtquick-controls qml-module-qtgraphicaleffects qml-module-qtquick-dialogs qml-module-qtquick-localstorage qml-module-qtquick-window2 qml-module-qt-labs-settings qml-module-qt-labs-folderlistmodel" "$(dirname "$0")" || exit 1
# Get CRT from github

@ -1,10 +1,16 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\\e[91m$1\\e[39m"
exit 1
}
rm -rf ~/.cache/cool-retro-term
rm -rf ~/cool-retro-term
rm -f ~/.local/share/applications/crt.desktop
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
"${DIRECTORY}/purge-installed" "$(dirname "$0")" || exit 1
rm -rf ~/.local/share/cool-retro-term ~/cool-retro-term

@ -1,10 +1,11 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
wget -O ~/Cura-mb-master-armhf-20200902.AppImage https://github.com/smartavionics/Cura/releases/download/20200922/Cura-mb-master-armhf-20200922.AppImage || error "Failed to download!"

@ -1,11 +1,11 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
rm -f ~/.local/share/applications/cura.desktop
rm -f ~/Cura-mb-master-armhf-20200902.AppImage
rm -rf ~/.cache/cura

@ -1,8 +1,9 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}

@ -1,8 +1,9 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}

@ -1,13 +1,13 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
# Get dependencies
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
"${DIRECTORY}/pkg-install" "cmake build-essential libtool lsb-release swig libboost-dev libboost-date-time-dev libboost-filesystem-dev libboost-graph-dev libboost-iostreams-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-serialization-dev libboost-signals-dev libboost-thread-dev libcoin-dev libeigen3-dev libgts-bin libgts-dev libkdtree++-dev libmedc-dev libopencv-dev libproj-dev libvtk6-dev libx11-dev libxerces-c-dev libzipios++-dev qt4-dev-tools libqt4-dev libqt4-opengl-dev libqtwebkit-dev libshiboken-dev libpyside-dev pyside-tools python-dev python-matplotlib python-pivy python-ply python-pyside libocct*-dev occt-draw libocct-data-exchange-dev libocct-draw-dev libocct-visualization-dev libsimage-dev doxygen libcoin-doc dh-exec libspnav-dev" "$(dirname "$0")" || exit 1
#download from google drive

@ -1,11 +1,11 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
"${DIRECTORY}/purge-installed" "$(dirname "$0")" || exit 1
sudo rm -f $(cat ~/freecad-build/install_manifest.txt) /home/pi/.local/share/applications/org.freecadweb.FreeCAD.desktop || error "failed to remove every installed file!"

@ -1,7 +1,9 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
@ -11,7 +13,6 @@ if [ "$answer" == 'n' ];then
exit 0
fi
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
"${DIRECTORY}/pkg-install" "cmake build-essential libtool lsb-release swig libboost-dev libboost-date-time-dev libboost-filesystem-dev libboost-graph-dev libboost-iostreams-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-serialization-dev libboost-signals-dev libboost-thread-dev libcoin-dev libeigen3-dev libgts-bin libgts-dev libkdtree++-dev libmedc-dev libopencv-dev libproj-dev libvtk6-dev libx11-dev libxerces-c-dev libzipios++-dev qt4-dev-tools libqt4-dev libqt4-opengl-dev libqtwebkit-dev libshiboken-dev libpyside-dev pyside-tools python-dev python-matplotlib python-pivy python-ply python-pyside libocct*-dev occt-draw libocct-data-exchange-dev libocct-draw-dev libocct-visualization-dev libsimage-dev doxygen libcoin-doc dh-exec libspnav-dev" "$(dirname "$0")" || exit 1
wget https://github.com/FreeCAD/FreeCAD/archive/0.18.4.zip || error "failed to download ZIP file!"

@ -1,11 +1,12 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
"${DIRECTORY}/purge-installed" "$(dirname "$0")" || exit 1
sudo rm -f $(cat ~/freecad-build/install_manifest.txt) /home/pi/.local/share/applications/org.freecadweb.FreeCAD.desktop || error "failed to remove every installed file!"

@ -1,8 +1,9 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}

@ -1,8 +1,9 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}

@ -1,12 +1,13 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
# Get dependencies
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
"${DIRECTORY}/pkg-install" "yad systemd-container xserver-xephyr expect" "$(dirname "$0")" || exit 1
wget -O - https://raw.githubusercontent.com/Botspot/Pi-Power-Tools/master/update | bash

@ -1,11 +1,11 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
"${DIRECTORY}/purge-installed" "$(dirname "$0")" || exit 1
rm -rf ${HOME}/Pi-Power-Tools ${HOME}/Pi-Power-Tools.old || error "failed on rm step 1!"

@ -1,12 +1,12 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
"${DIRECTORY}/pkg-install" "libpng12-dev" "$(dirname "$0")" || exit 1
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
"${DIRECTORY}/pkg-install" "libpng12-dev" "$(dirname "$0")" || exit 1
git clone https://github.com/AndrewFromMelbourne/raspi2png || error "failed to clone repository!"

@ -1,7 +1,9 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}

@ -1,12 +1,13 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
# Get dependencies
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
"${DIRECTORY}/pkg-install" "python-pip python-gobject-2 python-dbus python-tk python-gtk2 python-requests tkdnd" "$(dirname "$0")" || exit 1
cd ~ && wget https://github.com/KenT2/tboplayer/tarball/py2_version -O - | tar xz || error "Failed to download!"

@ -1,11 +1,11 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
"${DIRECTORY}/purge-installed" "$(dirname "$0")" || exit 1
#run uninstall script, saying 'yes' to the first question, and 'no' to the second question

@ -1,12 +1,13 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
# Get dependencies
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
"${DIRECTORY}/pkg-install" "xcompmgr tint2 gtk2-engines-murrine" "$(dirname "$0")" || exit 1
git clone https://github.com/Botspot/Windows-10 | error "failed to dowload github repository!"

@ -1,11 +1,11 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
~/Windows-10/uninstall | error "failed to uninstall!"
rm -rf ~/Windows-10

@ -1,8 +1,9 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}

@ -1,8 +1,9 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[31m$1\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}

@ -1,8 +1,9 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\\e[31m$1\\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}

@ -1,8 +1,9 @@
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")"
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\\e[31m$1\\e[39m"
echo -e "\\e[91m$1\\e[39m"
exit 1
}

Loading…
Cancel
Save