132 lines
2.6 KiB
Bash
132 lines
2.6 KiB
Bash
#!/bin/bash
|
|
|
|
### --- Dependencies --- ###
|
|
|
|
# If no > yes install
|
|
if [[ "$oDependenciesInstalled"="no" && "$dependenciesInstalled"="yes"]]; then
|
|
|
|
printf "+ Installing depandencies \n"
|
|
apt install openjdk-17-jre-headless screen
|
|
|
|
|
|
# if yes > no uninstall
|
|
if [[ "$oDependenciesInstalled"="yes" && "$dependenciesInstalled"="no"]]; then
|
|
|
|
printf "+ UNinstalling depandencies \n"
|
|
apt remove openjdk-17-jre-headless screen
|
|
|
|
|
|
# if yes > yes update
|
|
if [[ "$oDependenciesInstalled"="yes" && "$dependenciesInstalled"="yes"]]; then
|
|
|
|
printf "+ skiping dependencies check \n"
|
|
|
|
|
|
# if no > no restr
|
|
if [[ "$oDependenciesInstalled"="no" && "$dependenciesInstalled"="no"]]; then
|
|
|
|
pritf "+ skiping installation of dependencies \n"
|
|
|
|
else
|
|
|
|
#error handeling
|
|
|
|
fi
|
|
|
|
|
|
|
|
### --- User managment --- ###
|
|
|
|
# If no > yes install
|
|
if [[ "$oDependenciesInstalled"="no" && "$dependenciesInstalled"="yes"]]; then
|
|
|
|
printf "+ Installing depandencies \n"
|
|
apt install openjdk-17-jre-headless screen
|
|
|
|
|
|
# if yes > no uninstall
|
|
if [[ "$oDependenciesInstalled"="yes" && "$dependenciesInstalled"="no"]]; then
|
|
|
|
printf "+ UNinstalling depandencies \n"
|
|
apt remove openjdk-17-jre-headless screen
|
|
|
|
|
|
# if yes > yes update
|
|
if [[ "$oDependenciesInstalled"="yes" && "$dependenciesInstalled"="yes"]]; then
|
|
|
|
printf "+ skiping dependencies check \n"
|
|
|
|
|
|
# if no > no restr
|
|
if [[ "$oDependenciesInstalled"="no" && "$dependenciesInstalled"="no"]]; then
|
|
|
|
pritf "+ skiping installation of dependencies \n"
|
|
|
|
else
|
|
|
|
#error handeling
|
|
|
|
fi
|
|
|
|
|
|
### --- File Structure --- ###
|
|
|
|
# If no > yes install
|
|
if [[ "$oDependenciesInstalled"="no" && "$dependenciesInstalled"="yes"]]; then
|
|
|
|
printf "+ Installing depandencies \n"
|
|
apt install openjdk-17-jre-headless screen
|
|
|
|
|
|
# if yes > no uninstall
|
|
if [[ "$oDependenciesInstalled"="yes" && "$dependenciesInstalled"="no"]]; then
|
|
|
|
printf "+ UNinstalling depandencies \n"
|
|
apt remove openjdk-17-jre-headless screen
|
|
|
|
|
|
# if yes > yes update
|
|
if [[ "$oDependenciesInstalled"="yes" && "$dependenciesInstalled"="yes"]]; then
|
|
|
|
printf "+ skiping dependencies check \n"
|
|
|
|
|
|
# if no > no restr
|
|
if [[ "$oDependenciesInstalled"="no" && "$dependenciesInstalled"="no"]]; then
|
|
|
|
pritf "+ skiping installation of dependencies \n"
|
|
|
|
else
|
|
|
|
#error handeling
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
#
|
|
#
|
|
#
|
|
#
|
|
#
|
|
|
|
### User managment
|
|
|
|
printf "+ creating group and user for proxy \n"
|
|
groupadd velocity
|
|
|
|
useradd --system --shell /usr/sbin/nologin --home /opt/velocity -g velocity velocity
|
|
|
|
|
|
### File structure
|
|
|
|
printf "+ creating file structure in /opt/velocity/ \n"
|
|
mkdir /opt/velocity
|
|
|
|
cp data/velocity*.jar start.sh /opt/velocity/
|
|
|
|
mkdir /opt/velocity/plugins
|
|
|
|
cp data/velocity.toml data/forwarding.secret data/start.sh data/server-icon.png $baseInstallLocation
|