Merge remote-tracking branch 'upstream/main' into paperless-ngx

This commit is contained in:
Donkeykong307 2022-09-16 10:12:06 +10:00
commit ccbed9401c
60 changed files with 2405 additions and 520 deletions

View file

@ -3,6 +3,38 @@
# Change Log
All notable changes to this project will be documented in this file.
## 2022-09-11
### Changed
- **Trilium LXC**
- NEW Script
## 2022-09-10
### Changed
- **Syncthing LXC**
- NEW Script
## 2022-09-09
### Changed
- **CasaOS LXC**
- NEW Script
- **Proxmox Kernel Clean**
- Now works with Proxmox Backup Server
## 2022-09-08
### Changed
- **Navidrome LXC**
- NEW Script
- **Homepage LXC**
- NEW Script
## 2022-08-31
### Changed

220
README.md
View file

@ -2,7 +2,8 @@
<p align="center"><sub> Always remember to use due diligence when sourcing scripts and automation tasks from third-party sites. </sub></p>
<a href="https://github.com/tteck/Proxmox/blob/main/LICENSE"><img src="https://badgen.net/github/license/tteck/Proxmox" ></a> <a href="https://tteck.github.io/Proxmox/"><img src="https://badgen.net/github/checks/tteck/Proxmox/main/"></a> <a href="https://github.com/tteck/Proxmox/discussions"><img src="https://github.com/tteck/Proxmox/blob/main/misc/images/discussions.png?raw=true" height="21" /></a> <a href="https://github.com/tteck/Proxmox/blob/main/CHANGELOG.MD"><img src="https://github.com/tteck/Proxmox/blob/main/misc/images/change.png?raw=true" height="21" /></a>🔸
<a href="https://github.com/tteck/Proxmox/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" ></a> <a href="https://github.com/tteck/Proxmox/discussions"><img src="https://img.shields.io/badge/%F0%9F%92%AC-Discussions-orange" /></a> <a href="https://github.com/tteck/Proxmox/blob/main/CHANGELOG.MD"><img src="https://img.shields.io/badge/🔶-Changelog-blue" /></a> <a
href="https://ko-fi.com/D1D7EP4GF"><img src="https://img.shields.io/badge/%E2%98%95-Buy%20me%20a%20coffee-red" /></a>
<details>
<summary markdown="span"> Proxmox VE 7 Post Install</summary>
@ -865,8 +866,7 @@ advanced:
Run in the LXC console
```yaml
cd /opt/zigbee2mqtt
npm start
cd /opt/zigbee2mqtt && npm start
```
⚙️ **To update Zigbee2MQTT**
@ -1126,6 +1126,36 @@ ________________________________________________________________________________
</details>
<details>
<summary markdown="span"> 🔸CasaOS LXC </summary>
<p align="center"><img src="https://www.casaos.io/img/casa.svg" height="100"/></p>
<h1 align="center" id="heading"> CasaOS LXC </h1>
[CasaOS](https://www.casaos.io/) is a community-based open source software focused on delivering simple home cloud experience around Docker ecosystem.
To create a new Proxmox CasaOS LXC, run the following in the Proxmox Shell.
```
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/casaos-v4.sh)"
```
<h3 align="center" id="heading">⚡ Default Settings: 2GB RAM - 8GB Storage - 2vCPU ⚡</h3>
**CasaOS Interface - IP**
⚙️ **To Update CasaOS**
```yaml
update from the CasaOS UI
```
____________________________________________________________________________________________
</details>
<details>
<summary markdown="span"> Debian LXC </summary>
@ -1245,34 +1275,6 @@ ________________________________________________________________________________
</details>
<details>
<summary markdown="span"> MeshCentral LXC</summary>
<p align="center"><img src="https://github.com/Ylianst/MeshCentral/blob/master/public/favicon-303x303.png?raw=true" height="100"/></p>
<h1 align="center" id="heading"> MeshCentral LXC </h1>
MeshCentral is a full computer management web site. With MeshCentral, you can run your own web server to remotely manage and control computers on a local network or anywhere on the internet.
To create a new Proxmox MeshCentral LXC, run the following in the Proxmox Shell.
```yaml
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/meshcentral-v4.sh)"
```
<h3 align="center" id="heading">⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡</h3>
**MeshCentral Interface - http:// IP**
⚙️ **To Update MeshCentral**
```yaml
Update from the MeshCentral UI
```
____________________________________________________________________________________________
</details>
<details>
<summary markdown="span"> Plex Media Server LXC </summary>
@ -1505,6 +1507,36 @@ ________________________________________________________________________________
</details>
<details>
<summary markdown="span"> 🔸Trilium LXC </summary>
<p align="center"><img src="https://raw.githubusercontent.com/zadam/trilium/master/images/app-icons/png/128x128.png?raw=true" height="100"/></p>
<h1 align="center" id="heading"> Trilium LXC </h1>
[Trilium](https://github.com/zadam/trilium#trilium-notes) is a hierarchical note taking application with focus on building large personal knowledge bases.
To create a new Proxmox Trilium LXC, run the following in the Proxmox Shell.
```
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/trilium-v4.sh)"
```
<h3 align="center" id="heading">⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡</h3>
**Trilium Interface - IP:8080**
⚙️ **To Update Trilium**
Run in the LXC Console
```yaml
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/trilium-update.sh)"
```
____________________________________________________________________________________________
</details>
<details>
<summary markdown="span"> Wiki.js LXC </summary>
@ -1557,6 +1589,36 @@ ________________________________________________________________________________
</details>
<details>
<summary markdown="span"> Homepage LXC </summary>
<h1 align="center" id="heading"> Homepage LXC </h1>
[Homepage](https://github.com/benphelps/homepage) is a self-hosted dashboard.
To create a new Proxmox Homepage LXC, run the following in the Proxmox Shell.
```
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/homepage-v4.sh)"
```
<h3 align="center" id="heading">⚡ Default Settings: 1GB RAM - 3GB Storage - 2vCPU ⚡</h3>
[Configuration](https://github.com/benphelps/homepage/wiki) (bookmarks.yaml, services.yaml, widgets.yaml) path: `/opt/homepage/config/`
**Homepage Interface - IP:3000**
⚙️ **To Update Homepage**
Run in the LXC console
```yaml
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/homepage-update.sh)"
```
____________________________________________________________________________________________
</details>
<details>
<summary markdown="span"> Dashy LXC</summary>
@ -1689,6 +1751,38 @@ ________________________________________________________________________________
</details>
<details>
<summary markdown="span"> Navidrome LXC </summary>
<p align="center"><img src="https://raw.githubusercontent.com/navidrome/navidrome/master/resources/logo-192x192.png?raw=true" height="100"/></p>
<h1 align="center" id="heading"> Navidrome LXC </h1>
[Navidrome](https://www.navidrome.org/) allows you to enjoy your music collection from anywhere, by making it available through a modern Web UI and through a wide range of third-party compatible mobile apps, for both iOS and Android devices.
To create a new Proxmox Navidrome LXC, run the following in the Proxmox Shell.
```
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/navidrome-v4.sh)"
```
<h3 align="center" id="heading">⚡ Default Settings: 1GB RAM - 4GB Storage - 2vCPU ⚡</h3>
To change Navidrome music folder path, edit: `/var/lib/navidrome/navidrome.toml`
**Navidrome Interface - IP:4533**
⚙️ **To Update Navidrome**
Run in the LXC Console
```yaml
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/navidrome-update.sh)"
```
____________________________________________________________________________________________
</details>
<details>
<summary markdown="span"> PhotoPrism LXC </summary>
@ -1876,11 +1970,42 @@ bash /etc/webmin/uninstall.sh
```
___________________________________________________________________________________________
</details>
<details>
<summary markdown="span"> 🔸Syncthing LXC</summary>
<p align="center"><img src="https://raw.githubusercontent.com/syncthing/syncthing/6afaa9f20c8eb9c7af5abbe2f2d90fa2571aa7ad/assets/logo-only.svg?raw=true" height="100"/></p>
<h1 align="center" id="heading"> Syncthing LXC </h1>
[Syncthing](https://syncthing.net/) is a continuous file synchronization program. It synchronizes files between two or more computers.
To create a new Proxmox Syncthing LXC, run the following in the Proxmox Shell.
```yaml
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/syncthing-v4.sh)"
```
<h3 align="center" id="heading">⚡ Default Settings: 2GB RAM - 8GB Storage - 2vCPU ⚡</h3>
⚙️ For the initial start, run `syncthing --gui-address=0.0.0.0:8384` in the LXC console, then go to the LXC IP:8384 In settings set the LXC IP address under the GUI (also set the GUI Authentication User and GUI Authentication Password) and Connections tab's and save. Reboot the LXC.
**Syncthing Interface - IP:8384**
⚙️ **To Update Syncthing**
```yaml
apt update && apt upgrade -y
```
____________________________________________________________________________________________
</details>
<details>
<summary markdown="span"> WireGuard LXC </summary>
<p align="center"><img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fcdn.icon-icons.com%2Ficons2%2F2699%2FPNG%2F512%2Fwireguard_logo_icon_168760.png&f=1&nofb=1" height="100"/></p>
<h1 align="center" id="heading"> WireGuard LXC </h1>
@ -1929,6 +2054,35 @@ ________________________________________________________________________________
</details>
<details>
<summary markdown="span"> MeshCentral LXC</summary>
<p align="center"><img src="https://github.com/Ylianst/MeshCentral/blob/master/public/favicon-303x303.png?raw=true" height="100"/></p>
<h1 align="center" id="heading"> MeshCentral LXC </h1>
[MeshCentral](https://meshcentral.com/info/) is a full computer management web site. With MeshCentral, you can run your own web server to remotely manage and control computers on a local network or anywhere on the internet.
To create a new Proxmox MeshCentral LXC, run the following in the Proxmox Shell.
```yaml
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/meshcentral-v4.sh)"
```
<h3 align="center" id="heading">⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡</h3>
**MeshCentral Interface - http:// IP**
⚙️ **To Update MeshCentral**
```yaml
Update from the MeshCentral UI
```
____________________________________________________________________________________________
</details>
<details>
<summary markdown="span"> Tailscale</summary>
@ -2091,5 +2245,3 @@ bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/web-vault-
____________________________________________________________________________________________
</details>
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/D1D7EP4GF)

View file

@ -70,7 +70,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -98,16 +97,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -259,7 +248,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} Setup should be reachable by going to the following URL.
${BL}http://${IP}:3000${CL} \n"

260
ct/casaos-v4.sh Normal file
View file

@ -0,0 +1,260 @@
#!/usr/bin/env bash
echo -e "Loading..."
APP="CasaOS"
var_disk="8"
var_cpu="2"
var_ram="2048"
var_os="debian"
var_version="11"
NSAPP=$(echo ${APP,,} | tr -d ' ')
var_install="${NSAPP}-install"
NEXTID=$(pvesh get /cluster/nextid)
INTEGER='^[0-9]+$'
YW=`echo "\033[33m"`
BL=`echo "\033[36m"`
RD=`echo "\033[01;31m"`
BGN=`echo "\033[4;92m"`
GN=`echo "\033[1;92m"`
DGN=`echo "\033[32m"`
CL=`echo "\033[m"`
BFR="\\r\\033[K"
HOLD="-"
CM="${GN}${CL}"
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
shopt -s expand_aliases
alias die='EXIT=$? LINE=$LINENO error_exit'
trap die ERR
function error_exit() {
trap - ERR
local reason="Unknown failure occurred."
local msg="${1:-$reason}"
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
echo -e "$flag $msg" 1>&2
exit $EXIT
}
if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
echo "User selected Yes"
else
clear
echo -e "⚠ User exited script \n"
exit
fi
function header_info {
cat << "EOF"
______ ____ _____
/ ____/___ __v4______ _/ __ \/ ___/
/ / / __ `/ ___/ __ `/ / / /\__ \
/ /___/ /_/ (__ ) /_/ / /_/ /___/ /
\____/\__,_/____/\__,_/\____//____/
EOF
}
function msg_info() {
local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..."
}
function msg_ok() {
local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
function PVE_CHECK() {
PVE=$(pveversion | grep "pve-manager/7" | wc -l)
if [[ $PVE != 1 ]]; then
echo -e "${RD}This script requires Proxmox Virtual Environment 7.0 or greater${CL}"
echo -e "Exiting..."
sleep 2
exit
fi
}
function default_settings() {
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
PW=""
echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
CT_ID=$NEXTID
echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
HN=$NSAPP
echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
DISK_SIZE="$var_disk"
echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
CORE_COUNT="$var_cpu"
echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
RAM_SIZE="$var_ram"
echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
BRG="vmbr0"
echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
NET=dhcp
echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
GATE=""
echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
MAC=""
echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
VLAN=""
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
else
exit
fi
PW1=$(whiptail --inputbox "Set Root Password" 8 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
else
PW="-password $PW1"
echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
fi
fi
CT_ID=$(whiptail --inputbox "Set Container ID?" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
else
exit
fi
CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
HN=$(echo ${CT_NAME,,} | tr -d ' ')
echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
else
exit
fi
DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
else
exit
fi
CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
else
exit
fi
RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
else
exit
fi
BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
else
exit
fi
NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
else
exit
fi
GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $GATE1 ]; then GATE1="Default" GATE="";
echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
else
GATE=",gw=$GATE1"
echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
fi
fi
MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $MAC1 ]; then MAC1="Default" MAC="";
echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
else
MAC=",hwaddr=$MAC1"
echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
fi
fi
VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
else
VLAN=",tag=$VLAN1"
echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
fi
fi
if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
else
clear
header_info
echo -e "${RD}Using Advanced Settings${CL}"
advanced_settings
fi
}
function start_script() {
if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
header_info
echo -e "${BL}Using Default Settings${CL}"
default_settings
else
header_info
echo -e "${RD}Using Advanced Settings${CL}"
advanced_settings
fi
}
clear
start_script
if [ "$CT_TYPE" == "1" ]; then
FEATURES="nesting=1,keyctl=1"
else
FEATURES="nesting=1"
fi
TEMP_DIR=$(mktemp -d)
pushd $TEMP_DIR >/dev/null
export CTID=$CT_ID
export PCT_OSTYPE=$var_os
export PCT_OSVERSION=$var_version
export PCT_DISK_SIZE=$DISK_SIZE
export PCT_OPTIONS="
-features $FEATURES
-hostname $HN
-net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN
-onboot 1
-cores $CORE_COUNT
-memory $RAM_SIZE
-unprivileged $CT_TYPE
$PW
"
bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
cat <<EOF >> $LXC_CONFIG
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
EOF
msg_info "Starting LXC Container"
pct start $CTID
msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} Setup should be reachable by going to the following URL.
${BL}http://${IP} ${CL} \n"

View file

@ -70,7 +70,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -98,16 +97,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -259,7 +248,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8084${CL} \n"

View file

@ -70,7 +70,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -98,16 +97,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -259,7 +248,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:4000${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,5 +247,6 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} ${var_version} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"

View file

@ -70,8 +70,7 @@ fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
CT_TYPE="0"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
PW=""
@ -272,7 +271,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}${CL}\n"

View file

@ -69,9 +69,8 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
PW=""
echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -263,5 +252,6 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"

View file

@ -71,8 +71,7 @@ fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
CT_TYPE="0"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
PW=""
@ -271,7 +270,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8096${CL}\n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:6052${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:3000${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:7990${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -263,7 +252,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8123${CL}

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8581${CL} \n"

255
ct/homepage-v4.sh Normal file
View file

@ -0,0 +1,255 @@
#!/usr/bin/env bash
echo -e "Loading..."
APP="Homepage"
var_disk="3"
var_cpu="2"
var_ram="1024"
var_os="debian"
var_version="11"
NSAPP=$(echo ${APP,,} | tr -d ' ')
var_install="${NSAPP}-install"
NEXTID=$(pvesh get /cluster/nextid)
INTEGER='^[0-9]+$'
YW=`echo "\033[33m"`
BL=`echo "\033[36m"`
RD=`echo "\033[01;31m"`
BGN=`echo "\033[4;92m"`
GN=`echo "\033[1;92m"`
DGN=`echo "\033[32m"`
CL=`echo "\033[m"`
BFR="\\r\\033[K"
HOLD="-"
CM="${GN}${CL}"
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
shopt -s expand_aliases
alias die='EXIT=$? LINE=$LINENO error_exit'
trap die ERR
function error_exit() {
trap - ERR
local reason="Unknown failure occurred."
local msg="${1:-$reason}"
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
echo -e "$flag $msg" 1>&2
exit $EXIT
}
if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
echo "User selected Yes"
else
clear
echo -e "⚠ User exited script \n"
exit
fi
function header_info {
cat << "EOF"
__ __
/ / / /___ ____ ___ ___ ____ ____ _____ ____
/ /_/ / __ \/ __ `__ \/ _ \/ __ \/ __ `/ __ `/ _ \
/ __ / /_/ / / / / / / __/ /_/ / /_/ / /_/ / __/
/_/ /_/\____/_/ /_/ /_/\___/ .___/\__,_/\__, /\___/
/_/ v4 /____/
EOF
}
function msg_info() {
local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..."
}
function msg_ok() {
local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
function PVE_CHECK() {
PVE=$(pveversion | grep "pve-manager/7" | wc -l)
if [[ $PVE != 1 ]]; then
echo -e "${RD}This script requires Proxmox Virtual Environment 7.0 or greater${CL}"
echo -e "Exiting..."
sleep 2
exit
fi
}
function default_settings() {
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
PW=""
echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
CT_ID=$NEXTID
echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
HN=$NSAPP
echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
DISK_SIZE="$var_disk"
echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
CORE_COUNT="$var_cpu"
echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
RAM_SIZE="$var_ram"
echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
BRG="vmbr0"
echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
NET=dhcp
echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
GATE=""
echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
MAC=""
echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
VLAN=""
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
else
exit
fi
PW1=$(whiptail --inputbox "Set Root Password" 8 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
else
PW="-password $PW1"
echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
fi
fi
CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
else
exit
fi
CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
HN=$(echo ${CT_NAME,,} | tr -d ' ')
echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
else
exit
fi
DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
else
exit
fi
CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
else
exit
fi
RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
else
exit
fi
BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
else
exit
fi
NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
else
exit
fi
GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $GATE1 ]; then GATE1="Default" GATE="";
echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
else
GATE=",gw=$GATE1"
echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
fi
fi
MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $MAC1 ]; then MAC1="Default" MAC="";
echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
else
MAC=",hwaddr=$MAC1"
echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
fi
fi
VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
else
VLAN=",tag=$VLAN1"
echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
fi
fi
if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
else
clear
header_info
echo -e "${RD}Using Advanced Settings${CL}"
advanced_settings
fi
}
function start_script() {
if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
header_info
echo -e "${BL}Using Default Settings${CL}"
default_settings
else
header_info
echo -e "${RD}Using Advanced Settings${CL}"
advanced_settings
fi
}
clear
start_script
if [ "$CT_TYPE" == "1" ]; then
FEATURES="nesting=1,keyctl=1"
else
FEATURES="nesting=1"
fi
TEMP_DIR=$(mktemp -d)
pushd $TEMP_DIR >/dev/null
export CTID=$CT_ID
export PCT_OSTYPE=$var_os
export PCT_OSVERSION=$var_version
export PCT_DISK_SIZE=$DISK_SIZE
export PCT_OPTIONS="
-features $FEATURES
-hostname $HN
-net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN
-onboot 1
-cores $CORE_COUNT
-memory $RAM_SIZE
-unprivileged $CT_TYPE
$PW
"
bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
msg_info "Starting LXC Container"
pct start $CTID
msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} Setup should be reachable by going to the following URL.
${BL}http://${IP}:3000${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,5 +247,6 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8081${CL} \n"

View file

@ -270,7 +270,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8096${CL}\n"

View file

@ -70,7 +70,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -98,16 +97,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -259,7 +248,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8080${CL} \n"

View file

@ -70,7 +70,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -98,16 +97,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -259,7 +248,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8080${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "Adminer should be reachable by going to the following URL.
${BL}http://${IP}/adminer/${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8765${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,5 +247,6 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"

View file

@ -70,7 +70,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -98,16 +97,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -259,7 +248,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:5678${CL} \n"

254
ct/navidrome-v4.sh Normal file
View file

@ -0,0 +1,254 @@
#!/usr/bin/env bash
echo -e "Loading..."
APP="Navidrome"
var_disk="4"
var_cpu="2"
var_ram="1024"
var_os="debian"
var_version="11"
NSAPP=$(echo ${APP,,} | tr -d ' ')
var_install="${NSAPP}-install"
NEXTID=$(pvesh get /cluster/nextid)
INTEGER='^[0-9]+$'
YW=`echo "\033[33m"`
BL=`echo "\033[36m"`
RD=`echo "\033[01;31m"`
BGN=`echo "\033[4;92m"`
GN=`echo "\033[1;92m"`
DGN=`echo "\033[32m"`
CL=`echo "\033[m"`
BFR="\\r\\033[K"
HOLD="-"
CM="${GN}${CL}"
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
shopt -s expand_aliases
alias die='EXIT=$? LINE=$LINENO error_exit'
trap die ERR
function error_exit() {
trap - ERR
local reason="Unknown failure occurred."
local msg="${1:-$reason}"
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
echo -e "$flag $msg" 1>&2
exit $EXIT
}
if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
echo "User selected Yes"
else
clear
echo -e "⚠ User exited script \n"
exit
fi
function header_info {
cat << "EOF"
_ __ _ __
/ | / /___ __ v4__(_)___/ /________ ____ ___ ___
/ |/ / __ / | / / / __ / ___/ __ \/ __ __ \/ _ \
/ /| / /_/ /| |/ / / /_/ / / / /_/ / / / / / / __/
/_/ |_/\__,_/ |___/_/\__,_/_/ \____/_/ /_/ /_/\___/
EOF
}
function msg_info() {
local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..."
}
function msg_ok() {
local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
function PVE_CHECK() {
PVE=$(pveversion | grep "pve-manager/7" | wc -l)
if [[ $PVE != 1 ]]; then
echo -e "${RD}This script requires Proxmox Virtual Environment 7.0 or greater${CL}"
echo -e "Exiting..."
sleep 2
exit
fi
}
function default_settings() {
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
PW=""
echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
CT_ID=$NEXTID
echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
HN=$NSAPP
echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
DISK_SIZE="$var_disk"
echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
CORE_COUNT="$var_cpu"
echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
RAM_SIZE="$var_ram"
echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
BRG="vmbr0"
echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
NET=dhcp
echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
GATE=""
echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
MAC=""
echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
VLAN=""
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
else
exit
fi
PW1=$(whiptail --inputbox "Set Root Password" 8 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
else
PW="-password $PW1"
echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
fi
fi
CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
else
exit
fi
CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
HN=$(echo ${CT_NAME,,} | tr -d ' ')
echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
else
exit
fi
DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
else
exit
fi
CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
else
exit
fi
RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
else
exit
fi
BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
else
exit
fi
NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
else
exit
fi
GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $GATE1 ]; then GATE1="Default" GATE="";
echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
else
GATE=",gw=$GATE1"
echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
fi
fi
MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $MAC1 ]; then MAC1="Default" MAC="";
echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
else
MAC=",hwaddr=$MAC1"
echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
fi
fi
VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
else
VLAN=",tag=$VLAN1"
echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
fi
fi
if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
else
clear
header_info
echo -e "${RD}Using Advanced Settings${CL}"
advanced_settings
fi
}
function start_script() {
if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
header_info
echo -e "${BL}Using Default Settings${CL}"
default_settings
else
header_info
echo -e "${RD}Using Advanced Settings${CL}"
advanced_settings
fi
}
clear
start_script
if [ "$CT_TYPE" == "1" ]; then
FEATURES="nesting=1,keyctl=1"
else
FEATURES="nesting=1"
fi
TEMP_DIR=$(mktemp -d)
pushd $TEMP_DIR >/dev/null
export CTID=$CT_ID
export PCT_OSTYPE=$var_os
export PCT_OSVERSION=$var_version
export PCT_DISK_SIZE=$DISK_SIZE
export PCT_OPTIONS="
-features $FEATURES
-hostname $HN
-net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN
-onboot 1
-cores $CORE_COUNT
-memory $RAM_SIZE
-unprivileged $CT_TYPE
$PW
"
bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
msg_info "Starting LXC Container"
pct start $CTID
msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:4533${CL} \n"

View file

@ -70,7 +70,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -98,16 +97,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -259,7 +248,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/nginx-proxy-manager-install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:81${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8080/dashboard${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:1880${CL} \n"

View file

@ -70,9 +70,8 @@ fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
PW=""
echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
@ -93,8 +92,8 @@ function default_settings() {
GATE=""
echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
MAC=""
echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
VLAN=""
echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
VLAN=""
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
@ -261,7 +260,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}https://${IP}:8043${CL} \n"

View file

@ -70,7 +70,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -98,16 +97,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -259,7 +248,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8080${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:2342${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
CT_TYPE="0"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" OFF \
"0" "Privileged" ON \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}/admin${CL} \n"

View file

@ -270,7 +270,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:32400/web${CL}\n"

View file

@ -73,7 +73,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
CT_TYPE="0"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -101,16 +100,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" OFF \
"0" "Privileged" ON \
@ -267,7 +256,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8123${CL}

View file

@ -70,7 +70,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -98,16 +97,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -259,7 +248,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "Adminer should be reachable by going to the following URL.
${BL}http://${IP}/adminer/${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:9090${CL} \n"

256
ct/syncthing-v4.sh Normal file
View file

@ -0,0 +1,256 @@
#!/usr/bin/env bash
echo -e "Loading..."
APP="Syncthing"
var_disk="8"
var_cpu="2"
var_ram="2048"
var_os="debian"
var_version="11"
NSAPP=$(echo ${APP,,} | tr -d ' ')
var_install="${NSAPP}-install"
NEXTID=$(pvesh get /cluster/nextid)
INTEGER='^[0-9]+$'
YW=`echo "\033[33m"`
BL=`echo "\033[36m"`
RD=`echo "\033[01;31m"`
BGN=`echo "\033[4;92m"`
GN=`echo "\033[1;92m"`
DGN=`echo "\033[32m"`
CL=`echo "\033[m"`
BFR="\\r\\033[K"
HOLD="-"
CM="${GN}${CL}"
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
shopt -s expand_aliases
alias die='EXIT=$? LINE=$LINENO error_exit'
trap die ERR
function error_exit() {
trap - ERR
local reason="Unknown failure occurred."
local msg="${1:-$reason}"
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
echo -e "$flag $msg" 1>&2
exit $EXIT
}
if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
echo "User selected Yes"
else
clear
echo -e "⚠ User exited script \n"
exit
fi
function header_info {
cat << "EOF"
_____ __ __ _
/ ___/__ ______v4_____/ /_/ /_ (_)___ ____ _
\__ \/ / / / __ \/ ___/ __/ __ \/ / __ \/ __ `/
___/ / /_/ / / / / /__/ /_/ / / / / / / / /_/ /
/____/\__, /_/ /_/\___/\__/_/ /_/_/_/ /_/\__, /
/____/ /____/
EOF
}
function msg_info() {
local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..."
}
function msg_ok() {
local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
function PVE_CHECK() {
PVE=$(pveversion | grep "pve-manager/7" | wc -l)
if [[ $PVE != 1 ]]; then
echo -e "${RD}This script requires Proxmox Virtual Environment 7.0 or greater${CL}"
echo -e "Exiting..."
sleep 2
exit
fi
}
function default_settings() {
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
PW=""
echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
CT_ID=$NEXTID
echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
HN=$NSAPP
echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
DISK_SIZE="$var_disk"
echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
CORE_COUNT="$var_cpu"
echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
RAM_SIZE="$var_ram"
echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
BRG="vmbr0"
echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
NET=dhcp
echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
GATE=""
echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
MAC=""
echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
VLAN=""
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
else
exit
fi
PW1=$(whiptail --inputbox "Set Root Password" 8 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
else
PW="-password $PW1"
echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
fi
fi
CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
else
exit
fi
CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
HN=$(echo ${CT_NAME,,} | tr -d ' ')
echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
else
exit
fi
DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
else
exit
fi
CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
else
exit
fi
RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
else
exit
fi
BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
else
exit
fi
NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
else
exit
fi
GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $GATE1 ]; then GATE1="Default" GATE="";
echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
else
GATE=",gw=$GATE1"
echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
fi
fi
MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $MAC1 ]; then MAC1="Default" MAC="";
echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
else
MAC=",hwaddr=$MAC1"
echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
fi
fi
VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
else
VLAN=",tag=$VLAN1"
echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
fi
fi
if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
else
clear
header_info
echo -e "${RD}Using Advanced Settings${CL}"
advanced_settings
fi
}
function start_script() {
if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
header_info
echo -e "${BL}Using Default Settings${CL}"
default_settings
else
header_info
echo -e "${RD}Using Advanced Settings${CL}"
advanced_settings
fi
}
clear
start_script
if [ "$CT_TYPE" == "1" ]; then
FEATURES="nesting=1,keyctl=1"
else
FEATURES="nesting=1"
fi
TEMP_DIR=$(mktemp -d)
pushd $TEMP_DIR >/dev/null
export CTID=$CT_ID
export PCT_OSTYPE=$var_os
export PCT_OSVERSION=$var_version
export PCT_DISK_SIZE=$DISK_SIZE
export PCT_OPTIONS="
-features $FEATURES
-hostname $HN
-net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN
-onboot 1
-cores $CORE_COUNT
-memory $RAM_SIZE
-unprivileged $CT_TYPE
$PW
"
bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
msg_info "Starting LXC Container"
pct start $CTID
msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8384 ${CL} (after initial start) \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:5380${CL} \n"

255
ct/trilium-v4.sh Normal file
View file

@ -0,0 +1,255 @@
#!/usr/bin/env bash
echo -e "Loading..."
APP="Trilium"
var_disk="2"
var_cpu="1"
var_ram="512"
var_os="debian"
var_version="11"
NSAPP=$(echo ${APP,,} | tr -d ' ')
var_install="${NSAPP}-install"
NEXTID=$(pvesh get /cluster/nextid)
INTEGER='^[0-9]+$'
YW=`echo "\033[33m"`
BL=`echo "\033[36m"`
RD=`echo "\033[01;31m"`
BGN=`echo "\033[4;92m"`
GN=`echo "\033[1;92m"`
DGN=`echo "\033[32m"`
CL=`echo "\033[m"`
BFR="\\r\\033[K"
HOLD="-"
CM="${GN}${CL}"
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
shopt -s expand_aliases
alias die='EXIT=$? LINE=$LINENO error_exit'
trap die ERR
function error_exit() {
trap - ERR
local reason="Unknown failure occurred."
local msg="${1:-$reason}"
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
echo -e "$flag $msg" 1>&2
exit $EXIT
}
if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
echo "User selected Yes"
else
clear
echo -e "⚠ User exited script \n"
exit
fi
function header_info {
cat << "EOF"
______ _ ___
/_ __/_v4_(_) (_)_ ______ ___
/ / / ___/ / / / / / / __ `__ \
/ / / / / / / / /_/ / / / / / /
/_/ /_/ /_/_/_/\__,_/_/ /_/ /_/
EOF
}
function msg_info() {
local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..."
}
function msg_ok() {
local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
function PVE_CHECK() {
PVE=$(pveversion | grep "pve-manager/7" | wc -l)
if [[ $PVE != 1 ]]; then
echo -e "${RD}This script requires Proxmox Virtual Environment 7.0 or greater${CL}"
echo -e "Exiting..."
sleep 2
exit
fi
}
function default_settings() {
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
PW=""
echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
CT_ID=$NEXTID
echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
HN=$NSAPP
echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
DISK_SIZE="$var_disk"
echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
CORE_COUNT="$var_cpu"
echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
RAM_SIZE="$var_ram"
echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
BRG="vmbr0"
echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
NET=dhcp
echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
GATE=""
echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
MAC=""
echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
VLAN=""
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
else
exit
fi
PW1=$(whiptail --inputbox "Set Root Password" 8 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
else
PW="-password $PW1"
echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
fi
fi
CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
else
exit
fi
CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
HN=$(echo ${CT_NAME,,} | tr -d ' ')
echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
else
exit
fi
DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
else
exit
fi
CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
else
exit
fi
RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
else
exit
fi
BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
else
exit
fi
NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
else
exit
fi
GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $GATE1 ]; then GATE1="Default" GATE="";
echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
else
GATE=",gw=$GATE1"
echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
fi
fi
MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $MAC1 ]; then MAC1="Default" MAC="";
echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
else
MAC=",hwaddr=$MAC1"
echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
fi
fi
VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
else
VLAN=",tag=$VLAN1"
echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
fi
fi
if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
else
clear
header_info
echo -e "${RD}Using Advanced Settings${CL}"
advanced_settings
fi
}
function start_script() {
if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
header_info
echo -e "${BL}Using Default Settings${CL}"
default_settings
else
header_info
echo -e "${RD}Using Advanced Settings${CL}"
advanced_settings
fi
}
clear
start_script
if [ "$CT_TYPE" == "1" ]; then
FEATURES="nesting=1,keyctl=1"
else
FEATURES="nesting=1"
fi
TEMP_DIR=$(mktemp -d)
pushd $TEMP_DIR >/dev/null
export CTID=$CT_ID
export PCT_OSTYPE=$var_os
export PCT_OSVERSION=$var_version
export PCT_DISK_SIZE=$DISK_SIZE
export PCT_OPTIONS="
-features $FEATURES
-hostname $HN
-net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN
-onboot 1
-cores $CORE_COUNT
-memory $RAM_SIZE
-unprivileged $CT_TYPE
$PW
"
bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
msg_info "Starting LXC Container"
pct start $CTID
msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8080${CL} \n"

View file

@ -70,9 +70,8 @@ fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
PW=""
echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
@ -261,5 +260,6 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} ${var_version} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP}${CL} should be reachable by going to the following URL.
${BL}https://${IP}:8443${CL} \n"

View file

@ -70,7 +70,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -98,16 +97,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -259,7 +248,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:3001${CL} \n"

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_info "Setting Container to Normal Resources"
pct set $CTID -memory 512
pct set $CTID -cores 1

View file

@ -69,7 +69,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -97,16 +96,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -258,7 +247,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:5000${CL} \n"

View file

@ -70,7 +70,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -98,16 +97,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -259,7 +248,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:3000${CL} \n"

View file

@ -71,9 +71,8 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
CT_TYPE="1"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
PW=""
echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
@ -94,21 +93,11 @@ function default_settings() {
GATE=""
echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
MAC=""
echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
VLAN=""
echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
VLAN=""
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" ON \
"0" "Privileged" OFF \
@ -260,7 +249,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "WGDashboard should be reachable by going to the following URL.
${BL}http://${IP}:10086${CL} \n"

View file

@ -70,9 +70,8 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
CT_TYPE="0"
echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
CT_TYPE="0"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
PW=""
echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
@ -93,21 +92,11 @@ function default_settings() {
GATE=""
echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
MAC=""
echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
VLAN=""
echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
VLAN=""
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" OFF \
"0" "Privileged" ON \
@ -269,5 +258,6 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"

View file

@ -70,7 +70,6 @@ if [[ $PVE != 1 ]]; then
fi
}
function default_settings() {
echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
CT_TYPE="0"
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
@ -98,16 +97,6 @@ function default_settings() {
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
}
function advanced_settings() {
var_version=$(whiptail --title "DEBIAN VERSION" --radiolist "Choose Version" 10 58 2 \
"10" "Buster" OFF \
"11" "Bullseye" ON \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo -e "${DGN}Using Debian Version: ${BGN}$var_version${CL}"
else
exit
fi
CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
"1" "Unprivileged" OFF \
"0" "Privileged" ON \
@ -270,7 +259,8 @@ msg_ok "Started LXC Container"
lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/"
### https://tteck.github.io/Proxmox/
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8091${CL} \n"

72
misc/homepage-update.sh Normal file
View file

@ -0,0 +1,72 @@
#!/usr/bin/env bash
YW=`echo "\033[33m"`
BL=`echo "\033[36m"`
RD=`echo "\033[01;31m"`
BGN=`echo "\033[4;92m"`
GN=`echo "\033[1;92m"`
DGN=`echo "\033[32m"`
CL=`echo "\033[m"`
BFR="\\r\\033[K"
HOLD="-"
CM="${GN}${CL}"
APP="Homepage"
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
shopt -s expand_aliases
alias die='EXIT=$? LINE=$LINENO error_exit'
trap die ERR
function error_exit() {
trap - ERR
local reason="Unknown failure occured."
local msg="${1:-$reason}"
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
echo -e "$flag $msg" 1>&2
exit $EXIT
}
while true; do
read -p "This will Update ${APP}. Proceed(y/n)?" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
clear
function header_info {
cat << "EOF"
__ __
/ / / /___ ____ ___ ___ ____ ____ _____ ____
/ /_/ / __ \/ __ `__ \/ _ \/ __ \/ __ `/ __ `/ _ \
/ __ / /_/ / / / / / / __/ /_/ / /_/ / /_/ / __/
/_/ /_/\____/_/ /_/ /_/\___/ .___/\__,_/\__, /\___/
/_/ UPDATE /____/
EOF
}
header_info
function msg_info() {
local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..."
}
function msg_ok() {
local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
msg_info "Updating ${APP}"
if ! command -v pnpm >/dev/null 2>&1; then
npm install -g pnpm &>/dev/null
fi
cd /opt/homepage
systemctl stop homepage
git pull --force &>/dev/null
pnpm install &>/dev/null
pnpm build &>/dev/null
systemctl start homepage
msg_ok "Updated ${APP}"

View file

@ -14,7 +14,6 @@ CM="${GN}✓${CL}"
CROSS="${RD}${CL}"
PARTY="🎉"
current_kernel=$(uname -r)
pve=$(pveversion)
while true; do
read -p "This will Clean Unused Kernel Images, USE AT YOUR OWN RISK. Proceed(y/n)?" yn
@ -70,7 +69,9 @@ function edge_kernel() {
function kernel_info() {
latest_kernel=$(dpkg --list| grep 'kernel-.*-pve' | awk '{print $2}' | tac | head -n 1)
echo -e "${YW}PVE Version: ${BL}$pve\n${CL}"
if [[ "$MODE" != "PBS" ]]; then
echo -e "${YW}PVE Version: ${BL}$(pveversion)\n${CL}"
fi
if [[ "$current_kernel" == *"pve"* ]]; then
if [[ "$latest_kernel" != *"$current_kernel"* ]]; then
echo -e "${GN}Latest Kernel: $latest_kernel\n${CL}"
@ -120,4 +121,12 @@ msg_ok "Kernel Search Completed\n"
fi
}
if ! command -v pveversion >/dev/null 2>&1; then
echo -e " Switching to PBS mode"
MODE="PBS"
sleep 2
else
MODE="PVE"
fi
check_root

46
misc/navidrome-update.sh Normal file
View file

@ -0,0 +1,46 @@
#!/usr/bin/env bash
RELEASE=$(curl -s https://api.github.com/repos/navidrome/navidrome/releases/latest \
| grep "tag_name" \
| awk '{print substr($2, 3, length($2)-4) }')
RD=`echo "\033[01;31m"`
BL=`echo "\033[36m"`
CM='\xE2\x9C\x94\033'
GN=`echo "\033[1;92m"`
CL=`echo "\033[m"`
function update_info {
cat << "EOF"
_ __ _ __
/ | / /___ __ __(_)___/ /________ ____ ___ ___
/ |/ / __ / | / / / __ / ___/ __ \/ __ __ \/ _ \
/ /| / /_/ /| |/ / / /_/ / / / /_/ / / / / / / __/
/_/ |_/\__,_/ |___/_/\__,_/_/ \____/_/ /_/ /_/\___/
UPDATE
EOF
}
update_info
while true; do
read -p "This will Update Navidrome to v$RELEASE. Proceed(y/n)?" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
sleep 2
echo -e "${GN} Stopping Navidrome... ${CL}"
systemctl stop navidrome.service
sleep 1
echo -e "${GN} Updating to v${RELEASE}... ${CL}"
wget https://github.com/navidrome/navidrome/releases/download/v${RELEASE}/navidrome_${RELEASE}_Linux_x86_64.tar.gz -O Navidrome.tar.gz &>/dev/null
tar -xvzf Navidrome.tar.gz -C /opt/navidrome/ &>/dev/null
echo -e "${GN} Cleaning up... ${CL}"
rm Navidrome.tar.gz
echo -e "${GN} Starting Navidrome... ${CL}"
systemctl start navidrome.service
sleep 1
echo -e "${GN} Finished Update ${CL}"

47
misc/trilium-update.sh Normal file
View file

@ -0,0 +1,47 @@
#!/usr/bin/env bash
RELEASE=$(curl -s https://api.github.com/repos/zadam/trilium/releases/latest \
| grep "tag_name" \
| awk '{print substr($2, 3, length($2)-4) }')
RD=`echo "\033[01;31m"`
BL=`echo "\033[36m"`
CM='\xE2\x9C\x94\033'
GN=`echo "\033[1;92m"`
CL=`echo "\033[m"`
function update_info {
cat << "EOF"
______ _ ___
/_ __/____(_) (_)_ ______ ___
/ / / ___/ / / / / / / __ `__ \
/ / / / / / / / /_/ / / / / / /
/_/ /_/ /_/_/_/\__,_/_/ /_/ /_/
UPDATE
EOF
}
update_info
while true; do
read -p "This will Update Trilium to v$RELEASE. Proceed(y/n)?" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
sleep 2
echo -e "${GN} Stopping Trilium... ${CL}"
systemctl stop trilium.service
sleep 1
echo -e "${GN} Updating to v${RELEASE}... ${CL}"
wget -q https://github.com/zadam/trilium/releases/download/v$RELEASE/trilium-linux-x64-server-$RELEASE.tar.xz
tar -xzf trilium-linux-x64-server-$RELEASE.tar.xz -C /opt/trilium &>/dev/null
echo -e "${GN} Cleaning up... ${CL}"
rm trilium-linux-x64-server-$RELEASE.tar.xz
echo -e "${GN} Starting Trilium... ${CL}"
systemctl start trilium.service
sleep 1
echo -e "${GN} Finished Update ${CL}"

111
setup/casaos-install.sh Normal file
View file

@ -0,0 +1,111 @@
#!/usr/bin/env bash
YW=`echo "\033[33m"`
RD=`echo "\033[01;31m"`
BL=`echo "\033[36m"`
GN=`echo "\033[1;92m"`
CL=`echo "\033[m"`
RETRY_NUM=10
RETRY_EVERY=3
NUM=$RETRY_NUM
CM="${GN}${CL}"
CROSS="${RD}${CL}"
BFR="\\r\\033[K"
HOLD="-"
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
shopt -s expand_aliases
alias die='EXIT=$? LINE=$LINENO error_exit'
trap die ERR
function error_exit() {
trap - ERR
local reason="Unknown failure occurred."
local msg="${1:-$reason}"
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
echo -e "$flag $msg" 1>&2
exit $EXIT
}
function msg_info() {
local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..."
}
function msg_ok() {
local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
function msg_error() {
local msg="$1"
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
}
msg_info "Setting up Container OS "
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
locale-gen >/dev/null
while [ "$(hostname -I)" = "" ]; do
1>&2 echo -en "${CROSS}${RD} No Network! "
sleep $RETRY_EVERY
((NUM--))
if [ $NUM -eq 0 ]
then
1>&2 echo -e "${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
exit 1
fi
done
msg_ok "Set up Container OS"
msg_ok "Network Connected: ${BL}$(hostname -I)"
if nc -zw1 8.8.8.8 443; then msg_ok "Internet Connected"; else msg_error "Internet NOT Connected"; exit 1; fi;
RESOLVEDIP=$(nslookup "github.com" | awk -F':' '/^Address: / { matched = 1 } matched { print $2}' | xargs)
if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to $RESOLVEDIP"; fi;
msg_info "Updating Container OS"
apt-get update &>/dev/null
apt-get -y upgrade &>/dev/null
msg_ok "Updated Container OS"
msg_info "Installing Dependencies"
apt-get install -y curl &>/dev/null
apt-get install -y sudo &>/dev/null
apt-get install -y unzip &>/dev/null
msg_ok "Installed Dependencies"
DOCKER_CONFIG_PATH='/etc/docker/daemon.json'
mkdir -p $(dirname $DOCKER_CONFIG_PATH)
cat >$DOCKER_CONFIG_PATH <<'EOF'
{
"log-driver": "journald"
}
EOF
msg_info "Installing CasaOS (Patience)"
wget -qO- https://get.casaos.io | bash &>/dev/null
msg_ok "Installed CasaOS"
PASS=$(grep -w "root" /etc/shadow | cut -b6);
if [[ $PASS != $ ]]; then
msg_info "Customizing Container"
rm /etc/motd
rm /etc/update-motd.d/10-uname
touch ~/.hushlogin
GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
mkdir -p $(dirname $GETTY_OVERRIDE)
cat << EOF > $GETTY_OVERRIDE
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
EOF
systemctl daemon-reload
systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
msg_ok "Customized Container"
fi
msg_info "Cleaning up"
apt-get autoremove >/dev/null
apt-get autoclean >/dev/null
rm -rf /var/{cache,log}/* /var/lib/apt/lists/*
msg_ok "Cleaned"

132
setup/homepage-install.sh Normal file
View file

@ -0,0 +1,132 @@
#!/usr/bin/env bash
YW=`echo "\033[33m"`
RD=`echo "\033[01;31m"`
BL=`echo "\033[36m"`
GN=`echo "\033[1;92m"`
CL=`echo "\033[m"`
RETRY_NUM=10
RETRY_EVERY=3
NUM=$RETRY_NUM
CM="${GN}${CL}"
CROSS="${RD}${CL}"
BFR="\\r\\033[K"
HOLD="-"
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
shopt -s expand_aliases
alias die='EXIT=$? LINE=$LINENO error_exit'
trap die ERR
function error_exit() {
trap - ERR
local reason="Unknown failure occurred."
local msg="${1:-$reason}"
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
echo -e "$flag $msg" 1>&2
exit $EXIT
}
function msg_info() {
local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..."
}
function msg_ok() {
local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
function msg_error() {
local msg="$1"
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
}
msg_info "Setting up Container OS "
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
locale-gen >/dev/null
while [ "$(hostname -I)" = "" ]; do
1>&2 echo -en "${CROSS}${RD} No Network! "
sleep $RETRY_EVERY
((NUM--))
if [ $NUM -eq 0 ]
then
1>&2 echo -e "${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
exit 1
fi
done
msg_ok "Set up Container OS"
msg_ok "Network Connected: ${BL}$(hostname -I)"
if nc -zw1 8.8.8.8 443; then msg_ok "Internet Connected"; else msg_error "Internet NOT Connected"; exit 1; fi;
RESOLVEDIP=$(nslookup "github.com" | awk -F':' '/^Address: / { matched = 1 } matched { print $2}' | xargs)
if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to $RESOLVEDIP"; fi;
msg_info "Updating Container OS"
apt-get update &>/dev/null
apt-get -y upgrade &>/dev/null
msg_ok "Updated Container OS"
msg_info "Installing Dependencies"
apt-get install -y curl &>/dev/null
apt-get install -y sudo &>/dev/null
apt-get install -y git &>/dev/null
msg_ok "Installed Dependencies"
msg_info "Setting up Node.js Repository"
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - &>/dev/null
msg_ok "Set up Node.js Repository"
msg_info "Installing Node.js"
apt-get install -y nodejs &>/dev/null
npm install -g pnpm &>/dev/null
msg_ok "Installed Node.js"
msg_info "Installing Homepage"
git clone https://github.com/benphelps/homepage.git /opt/homepage &>/dev/null
cd /opt/homepage
mkdir -p config
pnpm install &>/dev/null
pnpm build &>/dev/null
msg_ok "Installed Homepage"
msg_info "Creating Service"
service_path="/etc/systemd/system/homepage.service"
echo "[Unit]
Description=Homepage
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
WorkingDirectory=/opt/homepage/
ExecStart=npm start
[Install]
WantedBy=multi-user.target" > $service_path
systemctl enable --now homepage &>/dev/null
msg_ok "Created Service"
PASS=$(grep -w "root" /etc/shadow | cut -b6);
if [[ $PASS != $ ]]; then
msg_info "Customizing Container"
chmod -x /etc/update-motd.d/*
touch ~/.hushlogin
GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
mkdir -p $(dirname $GETTY_OVERRIDE)
cat << EOF > $GETTY_OVERRIDE
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
EOF
systemctl daemon-reload
systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
msg_ok "Customized Container"
fi
msg_info "Cleaning up"
apt-get autoremove >/dev/null
apt-get autoclean >/dev/null
rm -rf /var/{cache,log}/* /var/lib/apt/lists/*
msg_ok "Cleaned"

151
setup/navidrome-install.sh Normal file
View file

@ -0,0 +1,151 @@
#!/usr/bin/env bash
YW=`echo "\033[33m"`
RD=`echo "\033[01;31m"`
BL=`echo "\033[36m"`
GN=`echo "\033[1;92m"`
CL=`echo "\033[m"`
RETRY_NUM=10
RETRY_EVERY=3
NUM=$RETRY_NUM
CM="${GN}${CL}"
CROSS="${RD}${CL}"
BFR="\\r\\033[K"
HOLD="-"
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
shopt -s expand_aliases
alias die='EXIT=$? LINE=$LINENO error_exit'
trap die ERR
function error_exit() {
trap - ERR
local reason="Unknown failure occurred."
local msg="${1:-$reason}"
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
echo -e "$flag $msg" 1>&2
exit $EXIT
}
function msg_info() {
local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..."
}
function msg_ok() {
local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
function msg_error() {
local msg="$1"
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
}
msg_info "Setting up Container OS "
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
locale-gen >/dev/null
while [ "$(hostname -I)" = "" ]; do
1>&2 echo -en "${CROSS}${RD} No Network! "
sleep $RETRY_EVERY
((NUM--))
if [ $NUM -eq 0 ]
then
1>&2 echo -e "${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
exit 1
fi
done
msg_ok "Set up Container OS"
msg_ok "Network Connected: ${BL}$(hostname -I)"
if nc -zw1 8.8.8.8 443; then msg_ok "Internet Connected"; else msg_error "Internet NOT Connected"; exit 1; fi;
RESOLVEDIP=$(nslookup "github.com" | awk -F':' '/^Address: / { matched = 1 } matched { print $2}' | xargs)
if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to $RESOLVEDIP"; fi;
msg_info "Updating Container OS"
apt-get update &>/dev/null
apt-get -y upgrade &>/dev/null
msg_ok "Updated Container OS"
msg_info "Installing Dependencies (patience)"
apt-get install -y curl &>/dev/null
apt-get install -y sudo &>/dev/null
apt-get install -y ffmpeg &>/dev/null
msg_ok "Installed Dependencies"
RELEASE=$(curl -s https://api.github.com/repos/navidrome/navidrome/releases/latest \
| grep "tag_name" \
| awk '{print substr($2, 3, length($2)-4) }')
msg_info "Installing Navidrome"
sudo install -d -o root -g root /opt/navidrome
sudo install -d -o root -g root /var/lib/navidrome
wget https://github.com/navidrome/navidrome/releases/download/v${RELEASE}/navidrome_${RELEASE}_Linux_x86_64.tar.gz -O Navidrome.tar.gz &>/dev/null
sudo tar -xvzf Navidrome.tar.gz -C /opt/navidrome/ &>/dev/null
sudo chown -R root:root /opt/navidrome
mkdir -p /music
cat <<EOF > /var/lib/navidrome/navidrome.toml
MusicFolder = '/music'
EOF
msg_ok "Installed Navidrome"
msg_info "Creating Service"
service_path="/etc/systemd/system/navidrome.service"
echo "[Unit]
Description=Navidrome Music Server and Streamer compatible with Subsonic/Airsonic
After=remote-fs.target network.target
AssertPathExists=/var/lib/navidrome
[Service]
User=root
Group=root
Type=simple
ExecStart=/opt/navidrome/navidrome --configfile '/var/lib/navidrome/navidrome.toml'
WorkingDirectory=/var/lib/navidrome
TimeoutStopSec=20
KillMode=process
Restart=on-failure
DevicePolicy=closed
NoNewPrivileges=yes
PrivateTmp=yes
PrivateUsers=yes
ProtectControlGroups=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
RestrictNamespaces=yes
RestrictRealtime=yes
SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap
ReadWritePaths=/var/lib/navidrome
ProtectSystem=full
[Install]
WantedBy=multi-user.target" > $service_path
systemctl daemon-reload
systemctl enable --now navidrome.service &>/dev/null
msg_ok "Created Service"
PASS=$(grep -w "root" /etc/shadow | cut -b6);
if [[ $PASS != $ ]]; then
msg_info "Customizing Container"
chmod -x /etc/update-motd.d/*
touch ~/.hushlogin
GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
mkdir -p $(dirname $GETTY_OVERRIDE)
cat << EOF > $GETTY_OVERRIDE
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
EOF
systemctl daemon-reload
systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
msg_ok "Customized Container"
fi
msg_info "Cleaning up"
apt-get autoremove >/dev/null
apt-get autoclean >/dev/null
rm -rf /var/{cache,log}/* /var/lib/apt/lists/* /root/Navidrome.tar.gz
msg_ok "Cleaned"

105
setup/syncthing-install.sh Normal file
View file

@ -0,0 +1,105 @@
#!/usr/bin/env bash
YW=`echo "\033[33m"`
RD=`echo "\033[01;31m"`
BL=`echo "\033[36m"`
GN=`echo "\033[1;92m"`
CL=`echo "\033[m"`
RETRY_NUM=10
RETRY_EVERY=3
NUM=$RETRY_NUM
CM="${GN}${CL}"
CROSS="${RD}${CL}"
BFR="\\r\\033[K"
HOLD="-"
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
shopt -s expand_aliases
alias die='EXIT=$? LINE=$LINENO error_exit'
trap die ERR
function error_exit() {
trap - ERR
local reason="Unknown failure occurred."
local msg="${1:-$reason}"
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
echo -e "$flag $msg" 1>&2
exit $EXIT
}
function msg_info() {
local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..."
}
function msg_ok() {
local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
function msg_error() {
local msg="$1"
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
}
msg_info "Setting up Container OS "
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
locale-gen >/dev/null
while [ "$(hostname -I)" = "" ]; do
1>&2 echo -en "${CROSS}${RD} No Network! "
sleep $RETRY_EVERY
((NUM--))
if [ $NUM -eq 0 ]
then
1>&2 echo -e "${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
exit 1
fi
done
msg_ok "Set up Container OS"
msg_ok "Network Connected: ${BL}$(hostname -I)"
if nc -zw1 8.8.8.8 443; then msg_ok "Internet Connected"; else msg_error "Internet NOT Connected"; exit 1; fi;
RESOLVEDIP=$(nslookup "github.com" | awk -F':' '/^Address: / { matched = 1 } matched { print $2}' | xargs)
if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to $RESOLVEDIP"; fi;
msg_info "Updating Container OS"
apt-get update &>/dev/null
apt-get -y upgrade &>/dev/null
msg_ok "Updated Container OS"
msg_info "Installing Dependencies"
apt-get install -y curl &>/dev/null
apt-get install -y sudo &>/dev/null
apt-get install -y gnupg &>/dev/null
msg_ok "Installed Dependencies"
msg_info "Installing Syncthing"
curl -o /usr/share/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg &>/dev/null
echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list &>/dev/null
apt-get update &>/dev/null
apt-get install -y syncthing &>/dev/null
systemctl enable syncthing@root.service &>/dev/null
msg_ok "Installed Syncthing"
PASS=$(grep -w "root" /etc/shadow | cut -b6);
if [[ $PASS != $ ]]; then
msg_info "Customizing Container"
chmod -x /etc/update-motd.d/*
touch ~/.hushlogin
GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
mkdir -p $(dirname $GETTY_OVERRIDE)
cat << EOF > $GETTY_OVERRIDE
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
EOF
systemctl daemon-reload
systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
msg_ok "Customized Container"
fi
msg_info "Cleaning up"
apt-get autoremove >/dev/null
apt-get autoclean >/dev/null
rm -rf /var/{cache,log}/* /var/lib/apt/lists/*
msg_ok "Cleaned"

126
setup/trilium-install.sh Normal file
View file

@ -0,0 +1,126 @@
#!/usr/bin/env bash
YW=`echo "\033[33m"`
RD=`echo "\033[01;31m"`
BL=`echo "\033[36m"`
GN=`echo "\033[1;92m"`
CL=`echo "\033[m"`
RETRY_NUM=10
RETRY_EVERY=3
NUM=$RETRY_NUM
CM="${GN}${CL}"
CROSS="${RD}${CL}"
BFR="\\r\\033[K"
HOLD="-"
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
shopt -s expand_aliases
alias die='EXIT=$? LINE=$LINENO error_exit'
trap die ERR
function error_exit() {
trap - ERR
local reason="Unknown failure occurred."
local msg="${1:-$reason}"
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
echo -e "$flag $msg" 1>&2
exit $EXIT
}
function msg_info() {
local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..."
}
function msg_ok() {
local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
function msg_error() {
local msg="$1"
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
}
msg_info "Setting up Container OS "
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
locale-gen >/dev/null
while [ "$(hostname -I)" = "" ]; do
1>&2 echo -en "${CROSS}${RD} No Network! "
sleep $RETRY_EVERY
((NUM--))
if [ $NUM -eq 0 ]
then
1>&2 echo -e "${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
exit 1
fi
done
msg_ok "Set up Container OS"
msg_ok "Network Connected: ${BL}$(hostname -I)"
if nc -zw1 8.8.8.8 443; then msg_ok "Internet Connected"; else msg_error "Internet NOT Connected"; exit 1; fi;
RESOLVEDIP=$(nslookup "github.com" | awk -F':' '/^Address: / { matched = 1 } matched { print $2}' | xargs)
if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to $RESOLVEDIP"; fi;
msg_info "Updating Container OS"
apt-get update &>/dev/null
apt-get -y upgrade &>/dev/null
msg_ok "Updated Container OS"
msg_info "Installing Dependencies"
apt-get install -y curl &>/dev/null
apt-get install -y sudo &>/dev/null
msg_ok "Installed Dependencies"
RELEASE=$(curl -s https://api.github.com/repos/zadam/trilium/releases/latest \
| grep "tag_name" \
| awk '{print substr($2, 3, length($2)-4) }')
msg_info "Installing Trilium"
wget -q https://github.com/zadam/trilium/releases/download/v$RELEASE/trilium-linux-x64-server-$RELEASE.tar.xz
tar -xvf trilium-linux-x64-server-$RELEASE.tar.xz &>/dev/null
mv trilium-linux-x64-server /opt/trilium
msg_ok "Installed Trilium"
msg_info "Creating Service"
service_path="/etc/systemd/system/trilium.service"
echo "[Unit]
Description=Trilium Daemon
After=syslog.target network.target
[Service]
User=root
Type=simple
ExecStart=/opt/trilium/trilium.sh
WorkingDirectory=/opt/trilium/
TimeoutStopSec=20
Restart=always
[Install]
WantedBy=multi-user.target" > $service_path
systemctl enable --now -q trilium
msg_ok "Created Service"
PASS=$(grep -w "root" /etc/shadow | cut -b6);
if [[ $PASS != $ ]]; then
msg_info "Customizing Container"
chmod -x /etc/update-motd.d/*
touch ~/.hushlogin
GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
mkdir -p $(dirname $GETTY_OVERRIDE)
cat << EOF > $GETTY_OVERRIDE
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
EOF
systemctl daemon-reload
systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
msg_ok "Customized Container"
fi
msg_info "Cleaning up"
apt-get autoremove >/dev/null
apt-get autoclean >/dev/null
rm -rf /var/{cache,log}/* /var/lib/apt/lists/* /root/trilium-linux-x64-server-$RELEASE.tar.xz
msg_ok "Cleaned"