Files
VPS-scripts_Readme/Vars.md
2020-09-09 11:34:24 +02:00

143 lines
2.5 KiB
Markdown

# Standard variable definition
## Git-Repo
### repo: defines repo where the script is pulling from
Options
```
repo=https://git.ictmaatwerk.com/VPS-scripts/<Repo name>
```
### branch: defines branch where the script is pulling from (requires repo to be set)
Options
```
branch=<Branch name>
```
Usage
```
wget -t7 "$repo"/raw/branch/"$branch"/installer.sh
```
### branchtype: defines type branch where the script is pulling from (requires repo and branch to be set)
Options
```
branchtype=branch # to pull a normal branch
branchtype=tag # to pull a release/tagged version
```
Usage
```
wget -t7 "$repo"/raw/"$branchtype"/"$branch"/installer.sh
```
## Package manager
### PKGM: defines package manager
Options
```
PKGM="apt" #Normal view
PKGM="debconf-apt-progress -- apt" #Whiptail view
```
Usage
```
As replacement for package manager command (example: apt)
Defining pakage manager for use in other Vars
```
### PKGI: defines command to install command (requires PKGM to be set)
Options
```
PKGI="${PKGM} install -y"
```
Usage
```
$PKGI <package name>
```
###PKGA: defines command to add repo
Options
```
PKGA="add-apt-repository" (software-properties-common is required)
```
Usage
```
$PKGA ppa:ondrej/php -y
```
## Other
###OUTPUT: used to silence a script
Options
```
OUTPUT='/dev/null' #Hide output
OUTPUT='/dev/tty' #Display output
```
Usage
```
YourCommand > $OUTPUT 2>&1
```
# Web-Server variable definition
###phpver: defines PHP Version (ppa:ondrej/php is required)
Options
```
phpver=7.3
phpver=7.2
phpver=7.1
phpver=7.0
phpver=5.6
```
Usage
```
apt install -y php${phpver}
```
###cockpit: defines if Cockpit will be installed
Options
```
cockpit=1
cockpit=0
```
Usage
```
if [ $cockpit = 1 ]; then
wget https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Cockpit/raw/branch/master/Slave-installer.sh -O Slave-Installer.sh
source Slave-Installer.sh
fi
```
# MySQL variable definition
###PHPMyadmin: enables or disables PHP Myadmin
Options
```
PHPMyadmin=1
PHPMyadmin=0
```
Usage
```
set when Mysql-Installer.sh sourced
```
###sqlver: defines MySQL Version that will be installed
Options
```
sqlver=8.0
sqlver=5.7
```
Usage
```
wget https://git.ictmaatwerk.com/VPS-scripts/MySQL/raw/branch/master/mysql-${sqlver}.sh -O Mysql-Installer.sh
source Mysql-Installer.sh
```
###phpmyadminver: defines PHP Myadmin version
Options
```
phpmyadminver=4.9.0.1 #is curent latest
```
Usage
```
Is defined in mysql-8.0.sh and mysql-5.7.sh and needs to be updated when new release comes out
```