mirror of
https://github.com/tteck/Proxmox.git
synced 2024-11-24 01:03:42 +01:00
commit
49b4c43de2
66
CHANGELOG.MD
66
CHANGELOG.MD
@ -5,74 +5,12 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
### ⚠️ [IMPORTANT NOTICE](https://github.com/tteck/Proxmox/issues/71#issue-1169207591)
|
||||
|
||||
## 2022-04-18
|
||||
## 2022-04-19
|
||||
|
||||
### Changed
|
||||
|
||||
- **Adguard LXC**
|
||||
- **ALL LXC's**
|
||||
- New [V3 Install Script](https://github.com/tteck/Proxmox/issues/162)
|
||||
- **Homebridge LXC**
|
||||
- New V3 Install Script
|
||||
- **Uptime Kuma LXC**
|
||||
- New V3 Install Script
|
||||
- **Vaultwarden LXC**
|
||||
- New V3 Install Script
|
||||
- **Motioneye LXC**
|
||||
- New V3 Install Script
|
||||
- **Nginx Proxy Manager LXC**
|
||||
- New V3 Install Script
|
||||
- **Daemon Sync Server LXC**
|
||||
- New V3 Install Script
|
||||
- **Dashy LXC**
|
||||
- New V3 Install Script
|
||||
- **Heimdall Dashboard LXC**
|
||||
- New V3 Install Script
|
||||
- **Wireguard LXC**
|
||||
- New V3 Install Script
|
||||
- **Node-Red LXC**
|
||||
- New V3 Install Script
|
||||
- **MQTT LXC**
|
||||
- New V3 Install Script
|
||||
- **Mariadb LXC**
|
||||
- New V3 Install Script
|
||||
- **Ubuntu 21.10 LXC**
|
||||
- New V3 Install Script
|
||||
- **NocoDB LXC**
|
||||
- New V3 Install Script
|
||||
- **Plex Media Server LXC**
|
||||
- New V3 Install Script
|
||||
- **Jellyfin Media Server LXC**
|
||||
- New V3 Install Script
|
||||
|
||||
## 2022-04-17
|
||||
|
||||
### Changed
|
||||
|
||||
- **Zigbee2MQTT LXC**
|
||||
- New V3 Install Script
|
||||
- **Zwavejs2MQTT LXC**
|
||||
- New V3 Install Script
|
||||
- **ESPHome LXC**
|
||||
- New V3 Install Script
|
||||
- **Technitium DNS LXC**
|
||||
- New V3 Install Script
|
||||
- **Podman Home Assistant LXC**
|
||||
- New V3 Install Script
|
||||
- **Docker LXC**
|
||||
- New V3 Install Script
|
||||
- **PhotoPrism LXC**
|
||||
- New V3 Install Script
|
||||
|
||||
## 2022-04-16
|
||||
|
||||
### Changed
|
||||
|
||||
- **Home Assistant OS VM**
|
||||
- New "Limited" V3 Install Script
|
||||
- **Home Assistant Container LXC**
|
||||
- New V3 Install Script
|
||||
- **Debian 11 LXC**
|
||||
- New V3 Install Script
|
||||
|
||||
## 2022-04-13
|
||||
|
||||
|
76
README.md
76
README.md
@ -104,7 +104,7 @@ ________________________________________________________________________________
|
||||
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Home Assistant OS VM</summary>
|
||||
<summary markdown="span"> Home Assistant OS VM</summary>
|
||||
|
||||
<p align="center"><img src="https://avatars.githubusercontent.com/u/13844975?s=200&v=4" alt="@home-assistant" width="100" height="100"/></p>
|
||||
|
||||
@ -127,7 +127,7 @@ ________________________________________________________________________________
|
||||
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Home Assistant Container LXC </summary>
|
||||
<summary markdown="span"> Home Assistant Container LXC </summary>
|
||||
|
||||
<p align="center"><img src="https://www.docker.com/sites/default/files/d8/2019-07/vertical-logo-monochromatic.png" alt="Docker Logos | Docker" width="100" height="100"/>
|
||||
<img src="https://avatars.githubusercontent.com/u/13844975?s=200&v=4" alt="@home-assistant" width="100" height="100"/><img src="https://avatars1.githubusercontent.com/u/22225832?s=400&v=4" alt="GitHub - portainer/portainer-docs: Portainer documentation" width="100" height="100"/></p>
|
||||
@ -201,7 +201,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Podman Home Assistant Container LXC </summary>
|
||||
<summary markdown="span"> Podman Home Assistant Container LXC </summary>
|
||||
|
||||
<p align="center"><img src="https://heise.cloudimg.io/width/223/q50.png-lossy-50.webp-lossy-50.foil1/_www-heise-de_/imgs/18/2/5/8/2/8/1/0/podman_logo-670078d7ea1d15a6.png" width="100" height="100"/>
|
||||
<img src="https://avatars.githubusercontent.com/u/13844975?s=200&v=4" alt="@home-assistant" width="100" height="100"/><img/><img src="https://raw.githubusercontent.com/SelfhostedPro/Yacht/master/readme_media/Yacht_logo_1_dark.png" height="80"/><img/></p>
|
||||
@ -271,7 +271,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Homebridge LXC</summary>
|
||||
<summary markdown="span"> Homebridge LXC</summary>
|
||||
|
||||
<p align="center"><img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.dingz.ch%2Fadmin%2Fdata%2Ffiles%2Fintegration%2Flogo%2F20%2F200514-em-logo-homebridge_logo.png%3Flm%3D1589459081&f=1&nofb=1" height="100"/></p>
|
||||
|
||||
@ -327,7 +327,7 @@ Update from the Homebridge UI
|
||||
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸ESPHome LXC</summary>
|
||||
<summary markdown="span"> ESPHome LXC</summary>
|
||||
|
||||
<p align="center"><img src="https://github.com/home-assistant/brands/blob/master/core_integrations/esphome/dark_icon@2x.png?raw=true" height="100"/></p>
|
||||
|
||||
@ -357,7 +357,7 @@ ________________________________________________________________________________
|
||||
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Nginx Proxy Manager LXC </summary>
|
||||
<summary markdown="span"> Nginx Proxy Manager LXC </summary>
|
||||
|
||||
<p align="center"><img src="https://nginxproxymanager.com/logo.png" alt="hero" height="100"/></p>
|
||||
|
||||
@ -407,7 +407,7 @@ bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/npm_update
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸MQTT LXC</summary>
|
||||
<summary markdown="span"> MQTT LXC</summary>
|
||||
|
||||
<p align="center"><img src="https://mosquitto.org/images/mosquitto-text-side-28.png" height="75"/></p>
|
||||
|
||||
@ -458,7 +458,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Node-Red LXC </summary>
|
||||
<summary markdown="span"> Node-Red LXC </summary>
|
||||
|
||||
<p align="center"><img src="https://github.com/home-assistant/brands/blob/master/custom_integrations/nodered/icon.png?raw=true" height="100"/></p>
|
||||
|
||||
@ -501,7 +501,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Mariadb LXC </summary>
|
||||
<summary markdown="span"> Mariadb LXC </summary>
|
||||
|
||||
<p align="center"><img src="https://mariadb.com/wp-content/webp-express/webp-images/doc-root/wp-content/themes/sage/dist/images/mariadb-logo-white.png.webp" alt="MariaDB"/><img src="https://raw.githubusercontent.com/tteck/Proxmox/main/misc/images/adminer_logo-cl.png" height="60"></p>
|
||||
|
||||
@ -612,7 +612,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Zigbee2MQTT LXC </summary>
|
||||
<summary markdown="span"> Zigbee2MQTT LXC </summary>
|
||||
|
||||
<p align="center"><img src="https://github.com/Koenkk/zigbee2mqtt/blob/master/images/logo_bee_only.png?raw=true" height="100"/></p>
|
||||
|
||||
@ -693,7 +693,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Zwavejs2MQTT LXC </summary>
|
||||
<summary markdown="span"> Zwavejs2MQTT LXC </summary>
|
||||
|
||||
<p align="center"><img src="https://github.com/zwave-js/zwavejs2mqtt/raw/master/docs/_images/zwavejs_logo.svg" height="100"/></p>
|
||||
|
||||
@ -726,7 +726,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸NocoDB LXC </summary>
|
||||
<summary markdown="span"> NocoDB LXC </summary>
|
||||
|
||||
<p align="center"><img src="https://github.com/tteck/Proxmox/blob/main/misc/images/nocodb.png?raw=true" height="100"/></p>
|
||||
|
||||
@ -762,16 +762,14 @@ ________________________________________________________________________________
|
||||
|
||||
<h1 align="center" id="heading"> InfluxDB/Telegraf LXC </h1>
|
||||
|
||||
To create a new Proxmox InfluxDB LXC, run the following in the Proxmox Shell (V2).
|
||||
To create a new Proxmox InfluxDB LXC, run the following in the Proxmox Shell.
|
||||
|
||||
```yaml
|
||||
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/influxdb.sh)"
|
||||
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/influxdb-v3.sh)"
|
||||
```
|
||||
|
||||
<h3 align="center" id="heading">⚡ Default Settings: 2GB RAM - 8GB Storage - 2vCPU ⚡</h3>
|
||||
|
||||
After the script completes, If you're dissatisfied with the default settings, click on the LXC, then on the **_Resources_** tab and change the settings to what you desire. Changes are immediate.
|
||||
|
||||
⚙️ **InfluxDB Configuration**
|
||||
|
||||
Run in the LXC console
|
||||
@ -804,16 +802,14 @@ ________________________________________________________________________________
|
||||
|
||||
<h1 align="center" id="heading"> Grafana LXC </h1>
|
||||
|
||||
To create a new Proxmox Grafana LXC, run the following in the Proxmox Shell (V2).
|
||||
To create a new Proxmox Grafana LXC, run the following in the Proxmox Shell.
|
||||
|
||||
```yaml
|
||||
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/grafana.sh)"
|
||||
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/grafana-v3.sh)"
|
||||
```
|
||||
|
||||
<h3 align="center" id="heading">⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡</h3>
|
||||
|
||||
After the script completes, If you're dissatisfied with the default settings, click on the LXC, then on the **_Resources_** tab and change the settings to what you desire. Changes are immediate.
|
||||
|
||||
**Grafana Interface - IP:3000**
|
||||
|
||||
⚙️ **Initial Login**
|
||||
@ -839,7 +835,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Docker LXC </summary>
|
||||
<summary markdown="span"> Docker LXC </summary>
|
||||
|
||||
<p align="center"><img src="https://raw.githubusercontent.com/tteck/Proxmox/main/misc/images/docker.png" height="100"/></p>
|
||||
|
||||
@ -868,7 +864,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Debian 11 LXC </summary>
|
||||
<summary markdown="span"> Debian 11 LXC </summary>
|
||||
|
||||
<p align="center"><img src="https://www.debian.org/Pics/debian-logo-1024x576.png" alt="Debian" height="100"/></p>
|
||||
|
||||
@ -895,7 +891,7 @@ ________________________________________________________________________________
|
||||
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Ubuntu 21.10 LXC </summary>
|
||||
<summary markdown="span"> Ubuntu 21.10 LXC </summary>
|
||||
|
||||
<p align="center"><img src="https://assets.ubuntu.com/v1/29985a98-ubuntu-logo32.png" alt="Ubuntu" height="100"/></p>
|
||||
|
||||
@ -932,7 +928,7 @@ An application designed to optimize UniFi home and business networks with ease.
|
||||
To create a new Proxmox UniFi Network Application LXC, run the following in the Proxmox Shell.
|
||||
|
||||
```yaml
|
||||
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/unifi.sh)"
|
||||
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/unifi-v3.sh)"
|
||||
```
|
||||
|
||||
<h3 align="center" id="heading">⚡ Default Settings: 2GB RAM - 8GB Storage - 2vCPU ⚡</h3>
|
||||
@ -961,7 +957,7 @@ Omada Controller is software which is used to manage the EAP
|
||||
To create a new Proxmox Omada Controller LXC, run the following in the Proxmox Shell.
|
||||
|
||||
```yaml
|
||||
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/omada.sh)"
|
||||
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/omada-v3.sh)"
|
||||
```
|
||||
|
||||
<h3 align="center" id="heading">⚡ Default Settings: 2GB RAM - 8GB Storage - 2vCPU ⚡</h3>
|
||||
@ -995,7 +991,7 @@ MeshCentral is a full computer management web site. With MeshCentral, you can ru
|
||||
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.sh)"
|
||||
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/meshcentral-v3.sh)"
|
||||
```
|
||||
|
||||
<h3 align="center" id="heading">⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡</h3>
|
||||
@ -1012,7 +1008,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Plex Media Server LXC </summary>
|
||||
<summary markdown="span"> Plex Media Server LXC </summary>
|
||||
|
||||
<p align="center"><img src="https://github.com/home-assistant/brands/blob/master/core_integrations/plex/icon.png?raw=true" height="100"/></p>
|
||||
|
||||
@ -1045,7 +1041,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Jellyfin Media Server LXC </summary>
|
||||
<summary markdown="span"> Jellyfin Media Server LXC </summary>
|
||||
<p align="center"><img src="https://github.com/home-assistant/brands/blob/master/core_integrations/jellyfin/icon.png?raw=true" height="100"/></p>
|
||||
<h1 align="center" id="heading"> Jellyfin Media Server LXC </h1>
|
||||
|
||||
@ -1077,10 +1073,10 @@ ________________________________________________________________________________
|
||||
|
||||
<h1 align="center" id="heading"> Pi-hole LXC </h1>
|
||||
|
||||
To create a new Proxmox Pi-hole LXC, run the following in the Proxmox Shell (V2).
|
||||
To create a new Proxmox Pi-hole LXC, run the following in the Proxmox Shell.
|
||||
|
||||
```yaml
|
||||
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/pihole.sh)"
|
||||
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/pihole-v3.sh)"
|
||||
```
|
||||
<h3 align="center" id="heading">⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡</h3>
|
||||
|
||||
@ -1102,7 +1098,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Technitium DNS LXC</summary>
|
||||
<summary markdown="span"> Technitium DNS LXC</summary>
|
||||
|
||||
<p align="center"><img src="https://avatars.githubusercontent.com/u/12230362?s=100&v=4" height="100"/></p>
|
||||
|
||||
@ -1130,7 +1126,7 @@ ________________________________________________________________________________
|
||||
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸AdGuard Home LXC</summary>
|
||||
<summary markdown="span"> AdGuard Home LXC</summary>
|
||||
|
||||
<p align="center"><img src="https://github.com/home-assistant/brands/blob/master/core_integrations/adguard/icon.png?raw=true" height="100"/></p>
|
||||
|
||||
@ -1158,7 +1154,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Uptime Kuma LXC </summary>
|
||||
<summary markdown="span"> Uptime Kuma LXC </summary>
|
||||
|
||||
<p align="center"><img src="https://github.com/louislam/uptime-kuma/blob/master/public/icon.png?raw=true" height="100"/></p>
|
||||
|
||||
@ -1188,7 +1184,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Heimdall Dashboard LXC</summary>
|
||||
<summary markdown="span"> Heimdall Dashboard LXC</summary>
|
||||
|
||||
<p align="center"><img src="https://github.com/tteck/Proxmox/blob/main/misc/images/heimdall.png?raw=true" height="100"/></p>
|
||||
|
||||
@ -1218,7 +1214,7 @@ ________________________________________________________________________________
|
||||
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Dashy LXC</summary>
|
||||
<summary markdown="span"> Dashy LXC</summary>
|
||||
|
||||
<p align="center"><img src="https://github.com/Lissy93/dashy/raw/master/public/web-icons/dashy-logo.png" height="100"/></p>
|
||||
|
||||
@ -1250,7 +1246,7 @@ ________________________________________________________________________________
|
||||
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸PhotoPrism LXC </summary>
|
||||
<summary markdown="span"> PhotoPrism LXC </summary>
|
||||
|
||||
<p align="center"><img src="https://github.com/tteck/Proxmox/blob/main/misc/images/photoprism.png?raw=true" height="100"/></p>
|
||||
|
||||
@ -1293,7 +1289,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Daemon Sync Server LXC</summary>
|
||||
<summary markdown="span"> Daemon Sync Server LXC</summary>
|
||||
|
||||
<p align="center"><img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fimg.informer.com%2Ficons_mac%2Fpng%2F128%2F350%2F350335.png&f=1&nofb=1" height="100"/></p>
|
||||
|
||||
@ -1318,7 +1314,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸MotionEye VMS LXC </summary>
|
||||
<summary markdown="span"> MotionEye VMS LXC </summary>
|
||||
|
||||
<p align="center"><img src="https://github.com/home-assistant/brands/blob/master/core_integrations/motioneye/icon.png?raw=true" height="100"/></p>
|
||||
|
||||
@ -1405,7 +1401,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸WireGuard LXC </summary>
|
||||
<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>
|
||||
|
||||
@ -1456,7 +1452,7 @@ ________________________________________________________________________________
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary markdown="span"> 🔸Vaultwarden LXC</summary>
|
||||
<summary markdown="span"> Vaultwarden LXC</summary>
|
||||
|
||||
<p align="center"><img src="https://raw.githubusercontent.com/dani-garcia/vaultwarden/main/resources/vaultwarden-icon-white.svg" width="100" height="100"/></p>
|
||||
|
||||
|
315
ct/grafana-v3.sh
Normal file
315
ct/grafana-v3.sh
Normal file
@ -0,0 +1,315 @@
|
||||
#!/usr/bin/env bash -ex
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
|
||||
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}"
|
||||
APP="Grafana"
|
||||
NSAPP=$(echo ${APP,,} | tr -d ' ')
|
||||
while true; do
|
||||
read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${YW}
|
||||
_____ __
|
||||
/ ____| / _|
|
||||
| | __ _ __ __ _| |_ __ _ _ __ __ _
|
||||
| | |_ | __/ _ | _/ _ | _ \ / _ |
|
||||
| |__| | | | (_| | || (_| | | | | (_| |
|
||||
\_____|_|v3\__,_|_| \__,_|_| |_|\__,_|
|
||||
${CL}"
|
||||
}
|
||||
|
||||
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}"
|
||||
}
|
||||
|
||||
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() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${BL}Using Default Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
|
||||
CT_TYPE="1"
|
||||
echo -e "${DGN}Using CT Password ${BGN}Automatic Login${CL}"
|
||||
PW=" "
|
||||
echo -e "${DGN}Using CT ID ${BGN}$NEXTID${CL}"
|
||||
CT_ID=$NEXTID
|
||||
echo -e "${DGN}Using CT Name ${BGN}$NSAPP${CL}"
|
||||
HN=$NSAPP
|
||||
echo -e "${DGN}Using Disk Size ${BGN}2GB${CL}"
|
||||
DISK_SIZE="2"
|
||||
echo -e "${DGN}Using ${BGN}1vCPU${CL}"
|
||||
CORE_COUNT="1"
|
||||
echo -e "${DGN}Using ${BGN}512MiB${CL}${DGN} RAM${CL}"
|
||||
RAM_SIZE="512"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
|
||||
NET=dhcp
|
||||
echo -e "${DGN}Using Gateway Address ${BGN}NONE${CL}"
|
||||
GATE=" "
|
||||
echo -e "${DGN}Using VLAN Tag ${BGN}NONE${CL}"
|
||||
VLAN=" "
|
||||
}
|
||||
|
||||
function advanced_settings() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${YW}Type Privileged, or Press [ENTER] for Default: Unprivileged (${RD}NO DEVICE PASSTHROUGH${CL}${YW})"
|
||||
read CT_TYPE1
|
||||
if [ -z $CT_TYPE1 ]; then CT_TYPE1="Unprivileged" CT_TYPE="1";
|
||||
echo -en "${DGN}Set CT Type ${BL}$CT_TYPE1${CL}"
|
||||
else
|
||||
CT_TYPE1="Privileged"
|
||||
CT_TYPE="0"
|
||||
echo -en "${DGN}Set CT Type ${BL}Privileged${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${YW}Set Password, or Press [ENTER] for Default: Automatic Login "
|
||||
read PW1
|
||||
if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
|
||||
echo -en "${DGN}Set CT ${BL}$PW1${CL}"
|
||||
else
|
||||
PW="-password $PW1"
|
||||
echo -en "${DGN}Set CT Password ${BL}$PW1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${YW}Enter the CT ID, or Press [ENTER] to automatically generate (${NEXTID}) "
|
||||
read CT_ID
|
||||
if [ -z $CT_ID ]; then CT_ID=$NEXTID; fi;
|
||||
echo -en "${DGN}Set CT ID To ${BL}$CT_ID${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${YW}Enter CT Name (no-spaces), or Press [ENTER] for Default: $NSAPP "
|
||||
read CT_NAME
|
||||
if [ -z $CT_NAME ]; then
|
||||
HN=$NSAPP
|
||||
else
|
||||
HN=$(echo ${CT_NAME,,} | tr -d ' ')
|
||||
fi
|
||||
echo -en "${DGN}Set CT Name To ${BL}$HN${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${YW}Enter a Disk Size, or Press [ENTER] for Default: 2Gb "
|
||||
read DISK_SIZE
|
||||
if [ -z $DISK_SIZE ]; then DISK_SIZE="2"; fi;
|
||||
if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo "ERROR! DISK SIZE MUST HAVE INTEGER NUMBER!"; exit; fi;
|
||||
echo -en "${DGN}Set Disk Size To ${BL}$DISK_SIZE${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${YW}Allocate CPU cores, or Press [ENTER] for Default: 1 "
|
||||
read CORE_COUNT
|
||||
if [ -z $CORE_COUNT ]; then CORE_COUNT="1"; fi;
|
||||
echo -en "${DGN}Set Cores To ${BL}$CORE_COUNT${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: 512 "
|
||||
read RAM_SIZE
|
||||
if [ -z $RAM_SIZE ]; then RAM_SIZE="512"; fi;
|
||||
echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}"
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${YW}Enter a Static IP Address, or Press [ENTER] for Default: DHCP "
|
||||
read NET
|
||||
if [ -z $NET ]; then NET="dhcp"; fi;
|
||||
echo -en "${DGN}Set Static IP Address To ${BL}$NET${CL}"
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${YW}Enter a Gateway IP, or Press [ENTER] for Default: NONE "
|
||||
read GATE1
|
||||
if [ -z $GATE1 ]; then GATE1="NONE" GATE=" ";
|
||||
echo -en "${DGN}Set Gateway IP To ${BL}$GATE1${CL}"
|
||||
else
|
||||
GATE=",gw=$GATE1"
|
||||
echo -en "${DGN}Set Gateway IP To ${BL}$GATE1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${DGN}Using Gateway IP Address ${BGN}$GATE1${CL}"
|
||||
echo -e "${YW}Enter a VLAN Tag, or Press [ENTER] for Default: NONE "
|
||||
read VLAN1
|
||||
if [ -z $VLAN1 ]; then VLAN1="NONE" VLAN=" ";
|
||||
echo -en "${DGN}Set VLAN Tag To ${BL}$VLAN1${CL}"
|
||||
else
|
||||
VLAN=",tag=$VLAN1"
|
||||
echo -en "${DGN}Set VLAN Tag To ${BL}$VLAN1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${DGN}Using Gateway IP Address ${BGN}$GATE1${CL}"
|
||||
echo -e "${DGN}Using VLAN Tag ${BGN}$VLAN1${CL}"
|
||||
|
||||
read -p "Are these settings correct(y/n)? " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
advanced_settings
|
||||
fi
|
||||
}
|
||||
|
||||
function start_script() {
|
||||
echo -e "${YW}Type Advanced, or Press [ENTER] for Default Settings "
|
||||
read SETTINGS
|
||||
if [ -z $SETTINGS ]; then default_settings;
|
||||
else
|
||||
advanced_settings
|
||||
fi;
|
||||
}
|
||||
|
||||
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=debian
|
||||
export PCT_OSVERSION=11
|
||||
export PCT_DISK_SIZE=$DISK_SIZE
|
||||
export PCT_OPTIONS="
|
||||
-features $FEATURES
|
||||
-hostname $HN
|
||||
-net0 name=eth0,bridge=vmbr0,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/grafana-install.sh)" || exit
|
||||
|
||||
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${APP} should be reachable by going to the following URL.
|
||||
${BL}http://${IP}:3000${CL} \n"
|
314
ct/influxdb-v3.sh
Normal file
314
ct/influxdb-v3.sh
Normal file
@ -0,0 +1,314 @@
|
||||
#!/usr/bin/env bash -ex
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
|
||||
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}"
|
||||
APP="InfluxDB"
|
||||
NSAPP=$(echo ${APP,,} | tr -d ' ')
|
||||
while true; do
|
||||
read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${YW}
|
||||
_____ __ _ _____ ____
|
||||
|_ _| / _| | | __ \| _ \
|
||||
| | _ __ | |_| |_ v3___ _| | | | |_) |
|
||||
| | | _ \| _| | | | \ \/ / | | | _ <
|
||||
_| |_| | | | | | | |_| |> <| |__| | |_) |
|
||||
|_____|_| |_|_| |_|\__,_/_/\_\_____/|____/
|
||||
with Telegraf
|
||||
${CL}"
|
||||
}
|
||||
|
||||
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}"
|
||||
}
|
||||
|
||||
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() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${BL}Using Default Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
|
||||
CT_TYPE="1"
|
||||
echo -e "${DGN}Using CT Password ${BGN}Automatic Login${CL}"
|
||||
PW=" "
|
||||
echo -e "${DGN}Using CT ID ${BGN}$NEXTID${CL}"
|
||||
CT_ID=$NEXTID
|
||||
echo -e "${DGN}Using CT Name ${BGN}$NSAPP${CL}"
|
||||
HN=$NSAPP
|
||||
echo -e "${DGN}Using Disk Size ${BGN}8GB${CL}"
|
||||
DISK_SIZE="8"
|
||||
echo -e "${DGN}Using ${BGN}2vCPU${CL}"
|
||||
CORE_COUNT="2"
|
||||
echo -e "${DGN}Using ${BGN}512MiB${CL}${DGN} RAM${CL}"
|
||||
RAM_SIZE="2048"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
|
||||
NET=dhcp
|
||||
echo -e "${DGN}Using Gateway Address ${BGN}NONE${CL}"
|
||||
GATE=" "
|
||||
echo -e "${DGN}Using VLAN Tag ${BGN}NONE${CL}"
|
||||
VLAN=" "
|
||||
}
|
||||
|
||||
function advanced_settings() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${YW}Type Privileged, or Press [ENTER] for Default: Unprivileged (${RD}NO DEVICE PASSTHROUGH${CL}${YW})"
|
||||
read CT_TYPE1
|
||||
if [ -z $CT_TYPE1 ]; then CT_TYPE1="Unprivileged" CT_TYPE="1";
|
||||
echo -en "${DGN}Set CT Type ${BL}$CT_TYPE1${CL}"
|
||||
else
|
||||
CT_TYPE1="Privileged"
|
||||
CT_TYPE="0"
|
||||
echo -en "${DGN}Set CT Type ${BL}Privileged${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${YW}Set Password, or Press [ENTER] for Default: Automatic Login "
|
||||
read PW1
|
||||
if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
|
||||
echo -en "${DGN}Set CT ${BL}$PW1${CL}"
|
||||
else
|
||||
PW="-password $PW1"
|
||||
echo -en "${DGN}Set CT Password ${BL}$PW1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${YW}Enter the CT ID, or Press [ENTER] to automatically generate (${NEXTID}) "
|
||||
read CT_ID
|
||||
if [ -z $CT_ID ]; then CT_ID=$NEXTID; fi;
|
||||
echo -en "${DGN}Set CT ID To ${BL}$CT_ID${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${YW}Enter CT Name (no-spaces), or Press [ENTER] for Default: $NSAPP "
|
||||
read CT_NAME
|
||||
if [ -z $CT_NAME ]; then
|
||||
HN=$NSAPP
|
||||
else
|
||||
HN=$(echo ${CT_NAME,,} | tr -d ' ')
|
||||
fi
|
||||
echo -en "${DGN}Set CT Name To ${BL}$HN${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${YW}Enter a Disk Size, or Press [ENTER] for Default: 8Gb "
|
||||
read DISK_SIZE
|
||||
if [ -z $DISK_SIZE ]; then DISK_SIZE="8"; fi;
|
||||
if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo "ERROR! DISK SIZE MUST HAVE INTEGER NUMBER!"; exit; fi;
|
||||
echo -en "${DGN}Set Disk Size To ${BL}$DISK_SIZE${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${YW}Allocate CPU cores, or Press [ENTER] for Default: 2 "
|
||||
read CORE_COUNT
|
||||
if [ -z $CORE_COUNT ]; then CORE_COUNT="2"; fi;
|
||||
echo -en "${DGN}Set Cores To ${BL}$CORE_COUNT${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: 2048 "
|
||||
read RAM_SIZE
|
||||
if [ -z $RAM_SIZE ]; then RAM_SIZE="2048"; fi;
|
||||
echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}"
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${YW}Enter a Static IP Address, or Press [ENTER] for Default: DHCP "
|
||||
read NET
|
||||
if [ -z $NET ]; then NET="dhcp"; fi;
|
||||
echo -en "${DGN}Set Static IP Address To ${BL}$NET${CL}"
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${YW}Enter a Gateway IP, or Press [ENTER] for Default: NONE "
|
||||
read GATE1
|
||||
if [ -z $GATE1 ]; then GATE1="NONE" GATE=" ";
|
||||
echo -en "${DGN}Set Gateway IP To ${BL}$GATE1${CL}"
|
||||
else
|
||||
GATE=",gw=$GATE1"
|
||||
echo -en "${DGN}Set Gateway IP To ${BL}$GATE1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${DGN}Using Gateway IP Address ${BGN}$GATE1${CL}"
|
||||
echo -e "${YW}Enter a VLAN Tag, or Press [ENTER] for Default: NONE "
|
||||
read VLAN1
|
||||
if [ -z $VLAN1 ]; then VLAN1="NONE" VLAN=" ";
|
||||
echo -en "${DGN}Set VLAN Tag To ${BL}$VLAN1${CL}"
|
||||
else
|
||||
VLAN=",tag=$VLAN1"
|
||||
echo -en "${DGN}Set VLAN Tag To ${BL}$VLAN1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${DGN}Using Gateway IP Address ${BGN}$GATE1${CL}"
|
||||
echo -e "${DGN}Using VLAN Tag ${BGN}$VLAN1${CL}"
|
||||
|
||||
read -p "Are these settings correct(y/n)? " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
advanced_settings
|
||||
fi
|
||||
}
|
||||
|
||||
function start_script() {
|
||||
echo -e "${YW}Type Advanced, or Press [ENTER] for Default Settings "
|
||||
read SETTINGS
|
||||
if [ -z $SETTINGS ]; then default_settings;
|
||||
else
|
||||
advanced_settings
|
||||
fi;
|
||||
}
|
||||
|
||||
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=debian
|
||||
export PCT_OSVERSION=11
|
||||
export PCT_DISK_SIZE=$DISK_SIZE
|
||||
export PCT_OPTIONS="
|
||||
-features $FEATURES
|
||||
-hostname $HN
|
||||
-net0 name=eth0,bridge=vmbr0,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/influxdb-install.sh)" || exit
|
||||
|
||||
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
@ -91,7 +91,7 @@ function advanced_settings() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${YW}Type ${CROSS} ${YW}Unprivileged, or Press [ENTER] for Default: Privileged"
|
||||
echo -e "${YW}Type ${CROSS}${YW}Unprivileged, or Press [ENTER] for Default: Privileged"
|
||||
read CT_TYPE1
|
||||
if [ -z $CT_TYPE1 ]; then CT_TYPE1="Privileged" CT_TYPE="0";
|
||||
echo -en "${DGN}Set CT Type ${BL}$CT_TYPE1${CL}"
|
||||
|
315
ct/meshcentral-v3.sh
Normal file
315
ct/meshcentral-v3.sh
Normal file
@ -0,0 +1,315 @@
|
||||
#!/usr/bin/env bash -ex
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
|
||||
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}"
|
||||
APP="MeshCentral"
|
||||
NSAPP=$(echo ${APP,,} | tr -d ' ')
|
||||
while true; do
|
||||
read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${BL}
|
||||
__ __ _ _____ _ _
|
||||
| \/ | | | / ____| | | | |
|
||||
| \ / | ___ ___| |__ | | ___ _ __ | |_ _ __ __ _| |
|
||||
| |\/| |/ _ \/ __| _ \| | v3 / _ \ _ \| __| __/ _ | |
|
||||
| | | | __/\__ \ | | | |___| __/ | | | |_| | | (_| | |
|
||||
|_| |_|\___||___/_| |_|\_____\___|_| |_|\__|_| \__,_|_|
|
||||
${CL}"
|
||||
}
|
||||
|
||||
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}"
|
||||
}
|
||||
|
||||
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() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${BL}Using Default Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
|
||||
CT_TYPE="1"
|
||||
echo -e "${DGN}Using CT Password ${BGN}Automatic Login${CL}"
|
||||
PW=" "
|
||||
echo -e "${DGN}Using CT ID ${BGN}$NEXTID${CL}"
|
||||
CT_ID=$NEXTID
|
||||
echo -e "${DGN}Using CT Name ${BGN}$NSAPP${CL}"
|
||||
HN=$NSAPP
|
||||
echo -e "${DGN}Using Disk Size ${BGN}2GB${CL}"
|
||||
DISK_SIZE="2"
|
||||
echo -e "${DGN}Using ${BGN}1vCPU${CL}"
|
||||
CORE_COUNT="1"
|
||||
echo -e "${DGN}Using ${BGN}512MiB${CL}${DGN} RAM${CL}"
|
||||
RAM_SIZE="512"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
|
||||
NET=dhcp
|
||||
echo -e "${DGN}Using Gateway Address ${BGN}NONE${CL}"
|
||||
GATE=" "
|
||||
echo -e "${DGN}Using VLAN Tag ${BGN}NONE${CL}"
|
||||
VLAN=" "
|
||||
}
|
||||
|
||||
function advanced_settings() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${YW}Type Privileged, or Press [ENTER] for Default: Unprivileged (${RD}NO DEVICE PASSTHROUGH${CL}${YW})"
|
||||
read CT_TYPE1
|
||||
if [ -z $CT_TYPE1 ]; then CT_TYPE1="Unprivileged" CT_TYPE="1";
|
||||
echo -en "${DGN}Set CT Type ${BL}$CT_TYPE1${CL}"
|
||||
else
|
||||
CT_TYPE1="Privileged"
|
||||
CT_TYPE="0"
|
||||
echo -en "${DGN}Set CT Type ${BL}Privileged${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${YW}Set Password, or Press [ENTER] for Default: Automatic Login "
|
||||
read PW1
|
||||
if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
|
||||
echo -en "${DGN}Set CT ${BL}$PW1${CL}"
|
||||
else
|
||||
PW="-password $PW1"
|
||||
echo -en "${DGN}Set CT Password ${BL}$PW1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${YW}Enter the CT ID, or Press [ENTER] to automatically generate (${NEXTID}) "
|
||||
read CT_ID
|
||||
if [ -z $CT_ID ]; then CT_ID=$NEXTID; fi;
|
||||
echo -en "${DGN}Set CT ID To ${BL}$CT_ID${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${YW}Enter CT Name (no-spaces), or Press [ENTER] for Default: $NSAPP "
|
||||
read CT_NAME
|
||||
if [ -z $CT_NAME ]; then
|
||||
HN=$NSAPP
|
||||
else
|
||||
HN=$(echo ${CT_NAME,,} | tr -d ' ')
|
||||
fi
|
||||
echo -en "${DGN}Set CT Name To ${BL}$HN${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${YW}Enter a Disk Size, or Press [ENTER] for Default: 2Gb "
|
||||
read DISK_SIZE
|
||||
if [ -z $DISK_SIZE ]; then DISK_SIZE="2"; fi;
|
||||
if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo "ERROR! DISK SIZE MUST HAVE INTEGER NUMBER!"; exit; fi;
|
||||
echo -en "${DGN}Set Disk Size To ${BL}$DISK_SIZE${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${YW}Allocate CPU cores, or Press [ENTER] for Default: 1 "
|
||||
read CORE_COUNT
|
||||
if [ -z $CORE_COUNT ]; then CORE_COUNT="1"; fi;
|
||||
echo -en "${DGN}Set Cores To ${BL}$CORE_COUNT${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: 512 "
|
||||
read RAM_SIZE
|
||||
if [ -z $RAM_SIZE ]; then RAM_SIZE="512"; fi;
|
||||
echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}"
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${YW}Enter a Static IP Address, or Press [ENTER] for Default: DHCP "
|
||||
read NET
|
||||
if [ -z $NET ]; then NET="dhcp"; fi;
|
||||
echo -en "${DGN}Set Static IP Address To ${BL}$NET${CL}"
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${YW}Enter a Gateway IP, or Press [ENTER] for Default: NONE "
|
||||
read GATE1
|
||||
if [ -z $GATE1 ]; then GATE1="NONE" GATE=" ";
|
||||
echo -en "${DGN}Set Gateway IP To ${BL}$GATE1${CL}"
|
||||
else
|
||||
GATE=",gw=$GATE1"
|
||||
echo -en "${DGN}Set Gateway IP To ${BL}$GATE1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${DGN}Using Gateway IP Address ${BGN}$GATE1${CL}"
|
||||
echo -e "${YW}Enter a VLAN Tag, or Press [ENTER] for Default: NONE "
|
||||
read VLAN1
|
||||
if [ -z $VLAN1 ]; then VLAN1="NONE" VLAN=" ";
|
||||
echo -en "${DGN}Set VLAN Tag To ${BL}$VLAN1${CL}"
|
||||
else
|
||||
VLAN=",tag=$VLAN1"
|
||||
echo -en "${DGN}Set VLAN Tag To ${BL}$VLAN1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${DGN}Using Gateway IP Address ${BGN}$GATE1${CL}"
|
||||
echo -e "${DGN}Using VLAN Tag ${BGN}$VLAN1${CL}"
|
||||
|
||||
read -p "Are these settings correct(y/n)? " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
advanced_settings
|
||||
fi
|
||||
}
|
||||
|
||||
function start_script() {
|
||||
echo -e "${YW}Type Advanced, or Press [ENTER] for Default Settings "
|
||||
read SETTINGS
|
||||
if [ -z $SETTINGS ]; then default_settings;
|
||||
else
|
||||
advanced_settings
|
||||
fi;
|
||||
}
|
||||
|
||||
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=debian
|
||||
export PCT_OSVERSION=11
|
||||
export PCT_DISK_SIZE=$DISK_SIZE
|
||||
export PCT_OPTIONS="
|
||||
-features $FEATURES
|
||||
-hostname $HN
|
||||
-net0 name=eth0,bridge=vmbr0,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/meshcentral-install.sh)" || exit
|
||||
|
||||
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${APP} should be reachable by going to the following URL.
|
||||
${BL}http://${IP}${CL} \n"
|
315
ct/omada-v3.sh
Normal file
315
ct/omada-v3.sh
Normal file
@ -0,0 +1,315 @@
|
||||
#!/usr/bin/env bash -ex
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
|
||||
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}"
|
||||
APP="Omada"
|
||||
NSAPP=$(echo ${APP,,} | tr -d ' ')
|
||||
while true; do
|
||||
read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${BL}
|
||||
____ _ _____ _ _ _
|
||||
/ __ \ | | / ____| | | | | |
|
||||
| | | |_ __ ___ v3__ _ __| | __ _ | | ___ _ __ | |_ _ __ ___ | | | ___ _ __
|
||||
| | | | _ _ \ / _ |/ _ |/ _ | | | / _ \| _ \| __| __/ _ \| | |/ _ \ __|
|
||||
| |__| | | | | | | (_| | (_| | (_| | | |___| (_) | | | | |_| | | (_) | | | __/ |
|
||||
\____/|_| |_| |_|\__,_|\__,_|\__,_| \_____\___/|_| |_|\__|_| \___/|_|_|\___|_|
|
||||
${CL}"
|
||||
}
|
||||
|
||||
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}"
|
||||
}
|
||||
|
||||
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() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${BL}Using Default Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
|
||||
CT_TYPE="1"
|
||||
echo -e "${DGN}Using CT Password ${BGN}Automatic Login${CL}"
|
||||
PW=" "
|
||||
echo -e "${DGN}Using CT ID ${BGN}$NEXTID${CL}"
|
||||
CT_ID=$NEXTID
|
||||
echo -e "${DGN}Using CT Name ${BGN}$NSAPP${CL}"
|
||||
HN=$NSAPP
|
||||
echo -e "${DGN}Using Disk Size ${BGN}8GB${CL}"
|
||||
DISK_SIZE="8"
|
||||
echo -e "${DGN}Using ${BGN}2vCPU${CL}"
|
||||
CORE_COUNT="2"
|
||||
echo -e "${DGN}Using ${BGN}2048MiB${CL}${DGN} RAM${CL}"
|
||||
RAM_SIZE="2048"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
|
||||
NET=dhcp
|
||||
echo -e "${DGN}Using Gateway Address ${BGN}NONE${CL}"
|
||||
GATE=" "
|
||||
echo -e "${DGN}Using VLAN Tag ${BGN}NONE${CL}"
|
||||
VLAN=" "
|
||||
}
|
||||
|
||||
function advanced_settings() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${YW}Type Privileged, or Press [ENTER] for Default: Unprivileged (${RD}NO DEVICE PASSTHROUGH${CL}${YW})"
|
||||
read CT_TYPE1
|
||||
if [ -z $CT_TYPE1 ]; then CT_TYPE1="Unprivileged" CT_TYPE="1";
|
||||
echo -en "${DGN}Set CT Type ${BL}$CT_TYPE1${CL}"
|
||||
else
|
||||
CT_TYPE1="Privileged"
|
||||
CT_TYPE="0"
|
||||
echo -en "${DGN}Set CT Type ${BL}Privileged${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${YW}Set Password, or Press [ENTER] for Default: Automatic Login "
|
||||
read PW1
|
||||
if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
|
||||
echo -en "${DGN}Set CT ${BL}$PW1${CL}"
|
||||
else
|
||||
PW="-password $PW1"
|
||||
echo -en "${DGN}Set CT Password ${BL}$PW1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${YW}Enter the CT ID, or Press [ENTER] to automatically generate (${NEXTID}) "
|
||||
read CT_ID
|
||||
if [ -z $CT_ID ]; then CT_ID=$NEXTID; fi;
|
||||
echo -en "${DGN}Set CT ID To ${BL}$CT_ID${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${YW}Enter CT Name (no-spaces), or Press [ENTER] for Default: $NSAPP "
|
||||
read CT_NAME
|
||||
if [ -z $CT_NAME ]; then
|
||||
HN=$NSAPP
|
||||
else
|
||||
HN=$(echo ${CT_NAME,,} | tr -d ' ')
|
||||
fi
|
||||
echo -en "${DGN}Set CT Name To ${BL}$HN${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${YW}Enter a Disk Size, or Press [ENTER] for Default: 8Gb "
|
||||
read DISK_SIZE
|
||||
if [ -z $DISK_SIZE ]; then DISK_SIZE="8"; fi;
|
||||
if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo "ERROR! DISK SIZE MUST HAVE INTEGER NUMBER!"; exit; fi;
|
||||
echo -en "${DGN}Set Disk Size To ${BL}$DISK_SIZE${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${YW}Allocate CPU cores, or Press [ENTER] for Default: 2 "
|
||||
read CORE_COUNT
|
||||
if [ -z $CORE_COUNT ]; then CORE_COUNT="2"; fi;
|
||||
echo -en "${DGN}Set Cores To ${BL}$CORE_COUNT${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: 2048 "
|
||||
read RAM_SIZE
|
||||
if [ -z $RAM_SIZE ]; then RAM_SIZE="2048"; fi;
|
||||
echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}"
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${YW}Enter a Static IP Address, or Press [ENTER] for Default: DHCP "
|
||||
read NET
|
||||
if [ -z $NET ]; then NET="dhcp"; fi;
|
||||
echo -en "${DGN}Set Static IP Address To ${BL}$NET${CL}"
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${YW}Enter a Gateway IP, or Press [ENTER] for Default: NONE "
|
||||
read GATE1
|
||||
if [ -z $GATE1 ]; then GATE1="NONE" GATE=" ";
|
||||
echo -en "${DGN}Set Gateway IP To ${BL}$GATE1${CL}"
|
||||
else
|
||||
GATE=",gw=$GATE1"
|
||||
echo -en "${DGN}Set Gateway IP To ${BL}$GATE1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${DGN}Using Gateway IP Address ${BGN}$GATE1${CL}"
|
||||
echo -e "${YW}Enter a VLAN Tag, or Press [ENTER] for Default: NONE "
|
||||
read VLAN1
|
||||
if [ -z $VLAN1 ]; then VLAN1="NONE" VLAN=" ";
|
||||
echo -en "${DGN}Set VLAN Tag To ${BL}$VLAN1${CL}"
|
||||
else
|
||||
VLAN=",tag=$VLAN1"
|
||||
echo -en "${DGN}Set VLAN Tag To ${BL}$VLAN1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${DGN}Using Gateway IP Address ${BGN}$GATE1${CL}"
|
||||
echo -e "${DGN}Using VLAN Tag ${BGN}$VLAN1${CL}"
|
||||
|
||||
read -p "Are these settings correct(y/n)? " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
advanced_settings
|
||||
fi
|
||||
}
|
||||
|
||||
function start_script() {
|
||||
echo -e "${YW}Type Advanced, or Press [ENTER] for Default Settings "
|
||||
read SETTINGS
|
||||
if [ -z $SETTINGS ]; then default_settings;
|
||||
else
|
||||
advanced_settings
|
||||
fi;
|
||||
}
|
||||
|
||||
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=ubuntu
|
||||
export PCT_OSVERSION=20.04
|
||||
export PCT_DISK_SIZE=$DISK_SIZE
|
||||
export PCT_OPTIONS="
|
||||
-features $FEATURES
|
||||
-hostname $HN
|
||||
-net0 name=eth0,bridge=vmbr0,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/omada-install.sh)" || exit
|
||||
|
||||
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${APP} should be reachable by going to the following URL.
|
||||
${BL}https://${IP}:8043${CL} \n"
|
315
ct/pihole-v3.sh
Normal file
315
ct/pihole-v3.sh
Normal file
@ -0,0 +1,315 @@
|
||||
#!/usr/bin/env bash -ex
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
|
||||
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}"
|
||||
APP="Pihole"
|
||||
NSAPP=$(echo ${APP,,} | tr -d ' ')
|
||||
while true; do
|
||||
read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${RD}
|
||||
_____ _____ _ _ ____ _ ______
|
||||
| __ \_ _| | | |/ __ \| | | ____|
|
||||
| |__) || | | |__| | | | | | | |__
|
||||
| ___/ | | | __ | | | | | | __|
|
||||
| | v3 _| |_| | | | |__| | |____| |____
|
||||
|_| |_____|_| |_|\____/|______|______|
|
||||
${CL}"
|
||||
}
|
||||
|
||||
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}"
|
||||
}
|
||||
|
||||
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() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${BL}Using Default Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
|
||||
CT_TYPE="1"
|
||||
echo -e "${DGN}Using CT Password ${BGN}Automatic Login${CL}"
|
||||
PW=" "
|
||||
echo -e "${DGN}Using CT ID ${BGN}$NEXTID${CL}"
|
||||
CT_ID=$NEXTID
|
||||
echo -e "${DGN}Using CT Name ${BGN}$NSAPP${CL}"
|
||||
HN=$NSAPP
|
||||
echo -e "${DGN}Using Disk Size ${BGN}2GB${CL}"
|
||||
DISK_SIZE="2"
|
||||
echo -e "${DGN}Using ${BGN}1vCPU${CL}"
|
||||
CORE_COUNT="1"
|
||||
echo -e "${DGN}Using ${BGN}512MiB${CL}${DGN} RAM${CL}"
|
||||
RAM_SIZE="512"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
|
||||
NET=dhcp
|
||||
echo -e "${DGN}Using Gateway Address ${BGN}NONE${CL}"
|
||||
GATE=" "
|
||||
echo -e "${DGN}Using VLAN Tag ${BGN}NONE${CL}"
|
||||
VLAN=" "
|
||||
}
|
||||
|
||||
function advanced_settings() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${YW}Type Privileged, or Press [ENTER] for Default: Unprivileged (${RD}NO DEVICE PASSTHROUGH${CL}${YW})"
|
||||
read CT_TYPE1
|
||||
if [ -z $CT_TYPE1 ]; then CT_TYPE1="Unprivileged" CT_TYPE="1";
|
||||
echo -en "${DGN}Set CT Type ${BL}$CT_TYPE1${CL}"
|
||||
else
|
||||
CT_TYPE1="Privileged"
|
||||
CT_TYPE="0"
|
||||
echo -en "${DGN}Set CT Type ${BL}Privileged${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${YW}Set Password, or Press [ENTER] for Default: Automatic Login "
|
||||
read PW1
|
||||
if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
|
||||
echo -en "${DGN}Set CT ${BL}$PW1${CL}"
|
||||
else
|
||||
PW="-password $PW1"
|
||||
echo -en "${DGN}Set CT Password ${BL}$PW1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${YW}Enter the CT ID, or Press [ENTER] to automatically generate (${NEXTID}) "
|
||||
read CT_ID
|
||||
if [ -z $CT_ID ]; then CT_ID=$NEXTID; fi;
|
||||
echo -en "${DGN}Set CT ID To ${BL}$CT_ID${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${YW}Enter CT Name (no-spaces), or Press [ENTER] for Default: $NSAPP "
|
||||
read CT_NAME
|
||||
if [ -z $CT_NAME ]; then
|
||||
HN=$NSAPP
|
||||
else
|
||||
HN=$(echo ${CT_NAME,,} | tr -d ' ')
|
||||
fi
|
||||
echo -en "${DGN}Set CT Name To ${BL}$HN${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${YW}Enter a Disk Size, or Press [ENTER] for Default: 2Gb "
|
||||
read DISK_SIZE
|
||||
if [ -z $DISK_SIZE ]; then DISK_SIZE="2"; fi;
|
||||
if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo "ERROR! DISK SIZE MUST HAVE INTEGER NUMBER!"; exit; fi;
|
||||
echo -en "${DGN}Set Disk Size To ${BL}$DISK_SIZE${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${YW}Allocate CPU cores, or Press [ENTER] for Default: 1 "
|
||||
read CORE_COUNT
|
||||
if [ -z $CORE_COUNT ]; then CORE_COUNT="1"; fi;
|
||||
echo -en "${DGN}Set Cores To ${BL}$CORE_COUNT${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: 512 "
|
||||
read RAM_SIZE
|
||||
if [ -z $RAM_SIZE ]; then RAM_SIZE="512"; fi;
|
||||
echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}"
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${YW}Enter a Static IP Address, or Press [ENTER] for Default: DHCP "
|
||||
read NET
|
||||
if [ -z $NET ]; then NET="dhcp"; fi;
|
||||
echo -en "${DGN}Set Static IP Address To ${BL}$NET${CL}"
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${YW}Enter a Gateway IP, or Press [ENTER] for Default: NONE "
|
||||
read GATE1
|
||||
if [ -z $GATE1 ]; then GATE1="NONE" GATE=" ";
|
||||
echo -en "${DGN}Set Gateway IP To ${BL}$GATE1${CL}"
|
||||
else
|
||||
GATE=",gw=$GATE1"
|
||||
echo -en "${DGN}Set Gateway IP To ${BL}$GATE1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${DGN}Using Gateway IP Address ${BGN}$GATE1${CL}"
|
||||
echo -e "${YW}Enter a VLAN Tag, or Press [ENTER] for Default: NONE "
|
||||
read VLAN1
|
||||
if [ -z $VLAN1 ]; then VLAN1="NONE" VLAN=" ";
|
||||
echo -en "${DGN}Set VLAN Tag To ${BL}$VLAN1${CL}"
|
||||
else
|
||||
VLAN=",tag=$VLAN1"
|
||||
echo -en "${DGN}Set VLAN Tag To ${BL}$VLAN1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${DGN}Using Gateway IP Address ${BGN}$GATE1${CL}"
|
||||
echo -e "${DGN}Using VLAN Tag ${BGN}$VLAN1${CL}"
|
||||
|
||||
read -p "Are these settings correct(y/n)? " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
advanced_settings
|
||||
fi
|
||||
}
|
||||
|
||||
function start_script() {
|
||||
echo -e "${YW}Type Advanced, or Press [ENTER] for Default Settings "
|
||||
read SETTINGS
|
||||
if [ -z $SETTINGS ]; then default_settings;
|
||||
else
|
||||
advanced_settings
|
||||
fi;
|
||||
}
|
||||
|
||||
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=debian
|
||||
export PCT_OSVERSION=11
|
||||
export PCT_DISK_SIZE=$DISK_SIZE
|
||||
export PCT_OPTIONS="
|
||||
-features $FEATURES
|
||||
-hostname $HN
|
||||
-net0 name=eth0,bridge=vmbr0,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/pihole-install.sh)" || exit
|
||||
|
||||
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${APP}${CL} should be reachable by going to the following URL.
|
||||
${BL}http://${IP}${CL} \n"
|
@ -89,7 +89,7 @@ function advanced_settings() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${YW}Type ${CROSS} ${YW}Unprivileged, or Press [ENTER] for Default: Privileged"
|
||||
echo -e "${YW}Type ${CROSS}${YW}Unprivileged, or Press [ENTER] for Default: Privileged"
|
||||
read CT_TYPE1
|
||||
if [ -z $CT_TYPE1 ]; then CT_TYPE1="Privileged" CT_TYPE="0";
|
||||
echo -en "${DGN}Set CT Type ${BL}$CT_TYPE1${CL}"
|
||||
|
315
ct/unifi-v3.sh
Normal file
315
ct/unifi-v3.sh
Normal file
@ -0,0 +1,315 @@
|
||||
#!/usr/bin/env bash -ex
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
|
||||
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}"
|
||||
APP="Unifi"
|
||||
NSAPP=$(echo ${APP,,} | tr -d ' ')
|
||||
while true; do
|
||||
read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${BL}
|
||||
_ _ _ ______ _
|
||||
| | | | (_) ____(_)
|
||||
| | | |_ __ _| |__ _
|
||||
| | | | _ \| | __| | |
|
||||
| |__| | | | | | | | |
|
||||
\____/|_| |_|_|_| v3 |_|
|
||||
${CL}"
|
||||
}
|
||||
|
||||
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}"
|
||||
}
|
||||
|
||||
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() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${BL}Using Default Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
|
||||
CT_TYPE="1"
|
||||
echo -e "${DGN}Using CT Password ${BGN}Automatic Login${CL}"
|
||||
PW=" "
|
||||
echo -e "${DGN}Using CT ID ${BGN}$NEXTID${CL}"
|
||||
CT_ID=$NEXTID
|
||||
echo -e "${DGN}Using CT Name ${BGN}$NSAPP${CL}"
|
||||
HN=$NSAPP
|
||||
echo -e "${DGN}Using Disk Size ${BGN}8GB${CL}"
|
||||
DISK_SIZE="8"
|
||||
echo -e "${DGN}Using ${BGN}2vCPU${CL}"
|
||||
CORE_COUNT="2"
|
||||
echo -e "${DGN}Using ${BGN}2048MiB${CL}${DGN} RAM${CL}"
|
||||
RAM_SIZE="2048"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
|
||||
NET=dhcp
|
||||
echo -e "${DGN}Using Gateway Address ${BGN}NONE${CL}"
|
||||
GATE=" "
|
||||
echo -e "${DGN}Using VLAN Tag ${BGN}NONE${CL}"
|
||||
VLAN=" "
|
||||
}
|
||||
|
||||
function advanced_settings() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${YW}Type Privileged, or Press [ENTER] for Default: Unprivileged (${RD}NO DEVICE PASSTHROUGH${CL}${YW})"
|
||||
read CT_TYPE1
|
||||
if [ -z $CT_TYPE1 ]; then CT_TYPE1="Unprivileged" CT_TYPE="1";
|
||||
echo -en "${DGN}Set CT Type ${BL}$CT_TYPE1${CL}"
|
||||
else
|
||||
CT_TYPE1="Privileged"
|
||||
CT_TYPE="0"
|
||||
echo -en "${DGN}Set CT Type ${BL}Privileged${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${YW}Set Password, or Press [ENTER] for Default: Automatic Login "
|
||||
read PW1
|
||||
if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
|
||||
echo -en "${DGN}Set CT ${BL}$PW1${CL}"
|
||||
else
|
||||
PW="-password $PW1"
|
||||
echo -en "${DGN}Set CT Password ${BL}$PW1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${YW}Enter the CT ID, or Press [ENTER] to automatically generate (${NEXTID}) "
|
||||
read CT_ID
|
||||
if [ -z $CT_ID ]; then CT_ID=$NEXTID; fi;
|
||||
echo -en "${DGN}Set CT ID To ${BL}$CT_ID${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${YW}Enter CT Name (no-spaces), or Press [ENTER] for Default: $NSAPP "
|
||||
read CT_NAME
|
||||
if [ -z $CT_NAME ]; then
|
||||
HN=$NSAPP
|
||||
else
|
||||
HN=$(echo ${CT_NAME,,} | tr -d ' ')
|
||||
fi
|
||||
echo -en "${DGN}Set CT Name To ${BL}$HN${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${YW}Enter a Disk Size, or Press [ENTER] for Default: 8Gb "
|
||||
read DISK_SIZE
|
||||
if [ -z $DISK_SIZE ]; then DISK_SIZE="8"; fi;
|
||||
if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo "ERROR! DISK SIZE MUST HAVE INTEGER NUMBER!"; exit; fi;
|
||||
echo -en "${DGN}Set Disk Size To ${BL}$DISK_SIZE${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${YW}Allocate CPU cores, or Press [ENTER] for Default: 2 "
|
||||
read CORE_COUNT
|
||||
if [ -z $CORE_COUNT ]; then CORE_COUNT="2"; fi;
|
||||
echo -en "${DGN}Set Cores To ${BL}$CORE_COUNT${CL}"
|
||||
echo -e " ${CM}${CL} \r"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: 2048 "
|
||||
read RAM_SIZE
|
||||
if [ -z $RAM_SIZE ]; then RAM_SIZE="2048"; fi;
|
||||
echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}"
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${YW}Enter a Static IP Address, or Press [ENTER] for Default: DHCP "
|
||||
read NET
|
||||
if [ -z $NET ]; then NET="dhcp"; fi;
|
||||
echo -en "${DGN}Set Static IP Address To ${BL}$NET${CL}"
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${YW}Enter a Gateway IP, or Press [ENTER] for Default: NONE "
|
||||
read GATE1
|
||||
if [ -z $GATE1 ]; then GATE1="NONE" GATE=" ";
|
||||
echo -en "${DGN}Set Gateway IP To ${BL}$GATE1${CL}"
|
||||
else
|
||||
GATE=",gw=$GATE1"
|
||||
echo -en "${DGN}Set Gateway IP To ${BL}$GATE1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${DGN}Using Gateway IP Address ${BGN}$GATE1${CL}"
|
||||
echo -e "${YW}Enter a VLAN Tag, or Press [ENTER] for Default: NONE "
|
||||
read VLAN1
|
||||
if [ -z $VLAN1 ]; then VLAN1="NONE" VLAN=" ";
|
||||
echo -en "${DGN}Set VLAN Tag To ${BL}$VLAN1${CL}"
|
||||
else
|
||||
VLAN=",tag=$VLAN1"
|
||||
echo -en "${DGN}Set VLAN Tag To ${BL}$VLAN1${CL}"
|
||||
fi;
|
||||
echo -e " ${CM}${CL} \n"
|
||||
sleep 1
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${DGN}Using CT Type ${BGN}$CT_TYPE1${CL}"
|
||||
echo -e "${DGN}Using CT Password ${BGN}$PW1${CL}"
|
||||
echo -e "${DGN}Using CT ID ${BGN}$CT_ID${CL}"
|
||||
echo -e "${DGN}Using CT Name ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${CORE_COUNT}vCPU${CL}"
|
||||
echo -e "${DGN}Using ${BGN}${RAM_SIZE}MiB${CL}${DGN} RAM${CL}"
|
||||
echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
|
||||
echo -e "${DGN}Using Gateway IP Address ${BGN}$GATE1${CL}"
|
||||
echo -e "${DGN}Using VLAN Tag ${BGN}$VLAN1${CL}"
|
||||
|
||||
read -p "Are these settings correct(y/n)? " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
advanced_settings
|
||||
fi
|
||||
}
|
||||
|
||||
function start_script() {
|
||||
echo -e "${YW}Type Advanced, or Press [ENTER] for Default Settings "
|
||||
read SETTINGS
|
||||
if [ -z $SETTINGS ]; then default_settings;
|
||||
else
|
||||
advanced_settings
|
||||
fi;
|
||||
}
|
||||
|
||||
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=debian
|
||||
export PCT_OSVERSION=11
|
||||
export PCT_DISK_SIZE=$DISK_SIZE
|
||||
export PCT_OPTIONS="
|
||||
-features $FEATURES
|
||||
-hostname $HN
|
||||
-net0 name=eth0,bridge=vmbr0,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/unifi-install.sh)" || exit
|
||||
|
||||
IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${APP}${CL} should be reachable by going to the following URL.
|
||||
${BL}https://${IP}:8443${CL} \n"
|
@ -13,6 +13,7 @@ CL=`echo "\033[m"`
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
APP="Zigbee2MQTT"
|
||||
NSAPP=$(echo ${APP,,} | tr -d ' ')
|
||||
while true; do
|
||||
@ -90,7 +91,7 @@ function advanced_settings() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${YW}Type Unprivileged, or Press [ENTER] for Default: Privileged"
|
||||
echo -e "${YW}Type ${CROSS}${YW}Unprivileged, or Press [ENTER] for Default: Privileged"
|
||||
read CT_TYPE1
|
||||
if [ -z $CT_TYPE1 ]; then CT_TYPE1="Privileged" CT_TYPE="0";
|
||||
echo -en "${DGN}Set CT Type ${BL}$CT_TYPE1${CL}"
|
||||
|
@ -13,6 +13,7 @@ CL=`echo "\033[m"`
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
APP="Zwavejs2MQTT"
|
||||
NSAPP=$(echo ${APP,,} | tr -d ' ')
|
||||
while true; do
|
||||
@ -89,7 +90,7 @@ function advanced_settings() {
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${YW}Type Unprivileged, or Press [ENTER] for Default: Privileged"
|
||||
echo -e "${YW}Type ${CROSS}${YW}Unprivileged, or Press [ENTER] for Default: Privileged"
|
||||
read CT_TYPE1
|
||||
if [ -z $CT_TYPE1 ]; then CT_TYPE1="Privileged" CT_TYPE="0";
|
||||
echo -en "${DGN}Set CT Type ${BL}$CT_TYPE1${CL}"
|
||||
|
@ -1,38 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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
|
||||
trap 'die "Script interrupted."' INT
|
||||
|
||||
function error_exit() {
|
||||
trap - ERR
|
||||
local DEFAULT='Unknown failure occured.'
|
||||
local REASON="\e[97m${1:-$DEFAULT}\e[39m"
|
||||
local FLAG="\e[91m[ERROR:LXC] \e[93m$EXIT@$LINE"
|
||||
msg "$FLAG $REASON"
|
||||
exit $EXIT
|
||||
}
|
||||
function msg() {
|
||||
local TEXT="$1"
|
||||
echo -e "$TEXT"
|
||||
}
|
||||
|
||||
#!/usr/bin/env bash -ex
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
YW=`echo "\033[33m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
RETRY_NUM=10
|
||||
RETRY_EVERY=3
|
||||
NUM=$RETRY_NUM
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
|
||||
echo -en "${GN} Setting up Container OS... "
|
||||
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 "Setting up Container OS "
|
||||
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
|
||||
locale-gen >/dev/null
|
||||
while [ "$(hostname -I)" = "" ]; do
|
||||
@ -45,36 +37,35 @@ while [ "$(hostname -I)" = "" ]; do
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo -e "${CM}${CL} \r"
|
||||
echo -en "${GN} Network Connected: ${BL}$(hostname -I)${CL} "
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Set up Container OS"
|
||||
msg_ok "Network Connected: ${BL}$(hostname -I)"
|
||||
|
||||
echo -en "${GN} Updating Container OS... "
|
||||
msg_info "Updating Container OS"
|
||||
apt update &>/dev/null
|
||||
apt-get -qqy upgrade &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Updated Container OS"
|
||||
|
||||
echo -en "${GN} Installing Dependencies... "
|
||||
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
|
||||
apt-get install -y apt-transport-https &>/dev/null
|
||||
apt-get install -y software-properties-common &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
echo -en "${GN} Setting up Grafana Repository... "
|
||||
msg_info "Setting up Grafana Repository"
|
||||
wget -qO- https://packages.grafana.com/gpg.key | sudo apt-key add - &>/dev/null
|
||||
echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Set up Grafana Repository"
|
||||
|
||||
echo -en "${GN} Installing Grafana... "
|
||||
msg_info "Installing Grafana"
|
||||
apt-get update &>/dev/null
|
||||
apt-get install -y grafana &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Installed Grafana"
|
||||
|
||||
PASS=$(grep -w "root" /etc/shadow | cut -b6);
|
||||
if [[ $PASS != $ ]]; then
|
||||
echo -en "${GN} Customizing Container... "
|
||||
msg_info "Customizing Container"
|
||||
rm /etc/motd
|
||||
rm /etc/update-motd.d/10-uname
|
||||
touch ~/.hushlogin
|
||||
@ -87,12 +78,13 @@ ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,3840
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Customized Container"
|
||||
fi
|
||||
systemctl start grafana-server
|
||||
systemctl enable grafana-server.service &>/dev/null
|
||||
echo -en "${GN} Cleanup... "
|
||||
|
||||
msg_info "Cleaning up"
|
||||
apt-get autoremove >/dev/null
|
||||
apt-get autoclean >/dev/null
|
||||
rm -rf /var/{cache,log}/* /var/lib/apt/lists/*
|
||||
echo -e "${CM}${CL} \n"
|
||||
msg_ok "Cleaned"
|
||||
|
@ -1,38 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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
|
||||
trap 'die "Script interrupted."' INT
|
||||
|
||||
function error_exit() {
|
||||
trap - ERR
|
||||
local DEFAULT='Unknown failure occured.'
|
||||
local REASON="\e[97m${1:-$DEFAULT}\e[39m"
|
||||
local FLAG="\e[91m[ERROR:LXC] \e[93m$EXIT@$LINE"
|
||||
msg "$FLAG $REASON"
|
||||
exit $EXIT
|
||||
}
|
||||
function msg() {
|
||||
local TEXT="$1"
|
||||
echo -e "$TEXT"
|
||||
}
|
||||
|
||||
#!/usr/bin/env bash -ex
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
YW=`echo "\033[33m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
RETRY_NUM=10
|
||||
RETRY_EVERY=3
|
||||
NUM=$RETRY_NUM
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
|
||||
echo -en "${GN} Setting up Container OS... "
|
||||
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 "Setting up Container OS "
|
||||
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
|
||||
locale-gen >/dev/null
|
||||
while [ "$(hostname -I)" = "" ]; do
|
||||
@ -45,40 +37,39 @@ while [ "$(hostname -I)" = "" ]; do
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo -e "${CM}${CL} \r"
|
||||
echo -en "${GN} Network Connected: ${BL}$(hostname -I)${CL} "
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Set up Container OS"
|
||||
msg_ok "Network Connected: ${BL}$(hostname -I)"
|
||||
|
||||
echo -en "${GN} Updating Container OS... "
|
||||
msg_info "Updating Container OS"
|
||||
apt update &>/dev/null
|
||||
apt-get -qqy upgrade &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Updated Container OS"
|
||||
|
||||
echo -en "${GN} Installing Dependencies... "
|
||||
msg_info "Installing Dependencies"
|
||||
apt-get install -y curl &>/dev/null
|
||||
apt-get install -y sudo &>/dev/null
|
||||
apt-get install -y lsb-base &>/dev/null
|
||||
apt-get install -y lsb-release &>/dev/null
|
||||
apt-get install -y gnupg2 &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
echo -en "${GN} Setting up InfluxDB Repository... "
|
||||
msg_info "Setting up InfluxDB Repository"
|
||||
wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add - &>/dev/null
|
||||
echo "deb https://repos.influxdata.com/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/influxdb.list &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Set up InfluxDB Repository"
|
||||
|
||||
echo -en "${GN} Installing InfluxDB... "
|
||||
msg_info "Installing InfluxDB"
|
||||
apt-get update &>/dev/null
|
||||
apt-get install -y influxdb &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Installed InfluxDB"
|
||||
|
||||
echo -en "${GN} Installing Telegraf... "
|
||||
msg_info "Installing Telegraf"
|
||||
apt-get install -y telegraf &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Installed Telegraf"
|
||||
|
||||
PASS=$(grep -w "root" /etc/shadow | cut -b6);
|
||||
if [[ $PASS != $ ]]; then
|
||||
echo -en "${GN} Customizing Container... "
|
||||
msg_info "Customizing Container"
|
||||
rm /etc/motd
|
||||
rm /etc/update-motd.d/10-uname
|
||||
touch ~/.hushlogin
|
||||
@ -91,11 +82,11 @@ ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,3840
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Customized Container"
|
||||
fi
|
||||
|
||||
echo -en "${GN} Cleanup... "
|
||||
|
||||
msg_info "Cleaning up"
|
||||
apt-get autoremove >/dev/null
|
||||
apt-get autoclean >/dev/null
|
||||
rm -rf /var/{cache,log}/* /var/lib/apt/lists/*
|
||||
echo -e "${CM}${CL} \n"
|
||||
msg_ok "Cleaned"
|
||||
|
@ -1,38 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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
|
||||
trap 'die "Script interrupted."' INT
|
||||
|
||||
function error_exit() {
|
||||
trap - ERR
|
||||
local DEFAULT='Unknown failure occured.'
|
||||
local REASON="\e[97m${1:-$DEFAULT}\e[39m"
|
||||
local FLAG="\e[91m[ERROR:LXC] \e[93m$EXIT@$LINE"
|
||||
msg "$FLAG $REASON"
|
||||
exit $EXIT
|
||||
}
|
||||
function msg() {
|
||||
local TEXT="$1"
|
||||
echo -e "$TEXT"
|
||||
}
|
||||
|
||||
#!/usr/bin/env bash -ex
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
YW=`echo "\033[33m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
RETRY_NUM=10
|
||||
RETRY_EVERY=3
|
||||
NUM=$RETRY_NUM
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
|
||||
echo -en "${GN} Setting up Container OS... "
|
||||
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 "Setting up Container OS "
|
||||
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
|
||||
locale-gen >/dev/null
|
||||
while [ "$(hostname -I)" = "" ]; do
|
||||
@ -45,38 +37,37 @@ while [ "$(hostname -I)" = "" ]; do
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo -e "${CM}${CL} \r"
|
||||
echo -en "${GN} Network Connected: ${BL}$(hostname -I)${CL} "
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Set up Container OS"
|
||||
msg_ok "Network Connected: ${BL}$(hostname -I)"
|
||||
|
||||
echo -en "${GN} Updating Container OS... "
|
||||
msg_info "Updating Container OS"
|
||||
apt update &>/dev/null
|
||||
apt-get -qqy upgrade &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Updated Container OS"
|
||||
|
||||
echo -en "${GN} Installing Dependencies... "
|
||||
msg_info "Installing Dependencies"
|
||||
apt-get install -y curl &>/dev/null
|
||||
apt-get install -y sudo &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
echo -en "${GN} Setting up Node.js Repository... "
|
||||
msg_info "Setting up Node.js Repository"
|
||||
sudo curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Set up Node.js Repository"
|
||||
|
||||
echo -en "${GN} Installing Node.js... "
|
||||
msg_lnfo "Installing Node.js"
|
||||
apt-get install -y nodejs &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Installed Node.js"
|
||||
|
||||
echo -en "${GN} Installing MeshCentral... "
|
||||
msg_info "Installing MeshCentral"
|
||||
mkdir /opt/meshcentral
|
||||
cd /opt/meshcentral
|
||||
npm install meshcentral &>/dev/null
|
||||
node node_modules/meshcentral --install &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Installed MeshCentral"
|
||||
|
||||
PASS=$(grep -w "root" /etc/shadow | cut -b6);
|
||||
if [[ $PASS != $ ]]; then
|
||||
echo -en "${GN} Customizing Container... "
|
||||
msg_info "Customizing Container"
|
||||
rm /etc/motd
|
||||
rm /etc/update-motd.d/10-uname
|
||||
touch ~/.hushlogin
|
||||
@ -89,11 +80,11 @@ ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,3840
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Customized Container"
|
||||
fi
|
||||
|
||||
echo -en "${GN} Cleanup... "
|
||||
msg_info "Cleaning up"
|
||||
apt-get autoremove >/dev/null
|
||||
apt-get autoclean >/dev/null
|
||||
rm -rf /var/{cache,log}/* /var/lib/apt/lists/*
|
||||
echo -e "${CM}${CL} \n"
|
||||
msg_ok "Cleaned"
|
||||
|
@ -1,38 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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
|
||||
trap 'die "Script interrupted."' INT
|
||||
|
||||
function error_exit() {
|
||||
trap - ERR
|
||||
local DEFAULT='Unknown failure occured.'
|
||||
local REASON="\e[97m${1:-$DEFAULT}\e[39m"
|
||||
local FLAG="\e[91m[ERROR:LXC] \e[93m$EXIT@$LINE"
|
||||
msg "$FLAG $REASON"
|
||||
exit $EXIT
|
||||
}
|
||||
function msg() {
|
||||
local TEXT="$1"
|
||||
echo -e "$TEXT"
|
||||
}
|
||||
|
||||
#!/usr/bin/env bash -ex
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
YW=`echo "\033[33m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
RETRY_NUM=10
|
||||
RETRY_EVERY=3
|
||||
NUM=$RETRY_NUM
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
|
||||
echo -en "${GN} Setting up Container OS... "
|
||||
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 "Setting up Container OS "
|
||||
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
|
||||
locale-gen >/dev/null
|
||||
while [ "$(hostname -I)" = "" ]; do
|
||||
@ -45,16 +37,15 @@ while [ "$(hostname -I)" = "" ]; do
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo -e "${CM}${CL} \r"
|
||||
echo -en "${GN} Network Connected: ${BL}$(hostname -I)${CL} "
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Set up Container OS"
|
||||
msg_ok "Network Connected: ${BL}$(hostname -I)"
|
||||
|
||||
echo -en "${GN} Updating Container OS... "
|
||||
apt-get update &>/dev/null
|
||||
apt-get -y upgrade &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_info "Updating Container OS"
|
||||
apt update &>/dev/null
|
||||
apt-get -qqy upgrade &>/dev/null
|
||||
msg_ok "Updated Container OS"
|
||||
|
||||
echo -en "${GN} Installing Dependencies... "
|
||||
msg_info "Installing Dependencies"
|
||||
apt-get -y install curl &>/dev/null
|
||||
apt-get -y install sudo &>/dev/null
|
||||
apt-get -y install gnupg &>/dev/null
|
||||
@ -65,16 +56,16 @@ wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add
|
||||
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list &>/dev/null
|
||||
apt-get update &>/dev/null
|
||||
apt-get -y install mongodb-org &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
echo -en "${GN} Installing Omada Controller... "
|
||||
msg_info "Installing Omada Controller"
|
||||
wget -qL https://static.tp-link.com/upload/software/2022/202201/20220120/Omada_SDN_Controller_v5.0.30_linux_x64.deb
|
||||
sudo dpkg -i Omada_SDN_Controller_v5.0.30_linux_x64.deb &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Installed Omada Controller"
|
||||
|
||||
PASS=$(grep -w "root" /etc/shadow | cut -b6);
|
||||
if [[ $PASS != $ ]]; then
|
||||
echo -en "${GN} Customizing Container... "
|
||||
msg_info "Customizing Container"
|
||||
chmod -x /etc/update-motd.d/*
|
||||
touch ~/.hushlogin
|
||||
GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
|
||||
@ -86,11 +77,11 @@ ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,3840
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Customized Container"
|
||||
fi
|
||||
|
||||
echo -en "${GN} Cleaning Up... "
|
||||
|
||||
msg_info "Cleaning up"
|
||||
apt-get autoremove >/dev/null
|
||||
apt-get autoclean >/dev/null
|
||||
rm -rf /tmp/* /var/lib/apt/lists/*
|
||||
echo -e "${CM}${CL} \n"
|
||||
rm -rf /var/{cache,log}/* /var/lib/apt/lists/*
|
||||
msg_ok "Cleaned"
|
||||
|
@ -1,38 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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
|
||||
trap 'die "Script interrupted."' INT
|
||||
|
||||
function error_exit() {
|
||||
trap - ERR
|
||||
local DEFAULT='Unknown failure occured.'
|
||||
local REASON="\e[97m${1:-$DEFAULT}\e[39m"
|
||||
local FLAG="\e[91m[ERROR:LXC] \e[93m$EXIT@$LINE"
|
||||
msg "$FLAG $REASON"
|
||||
exit $EXIT
|
||||
}
|
||||
function msg() {
|
||||
local TEXT="$1"
|
||||
echo -e "$TEXT"
|
||||
}
|
||||
|
||||
#!/usr/bin/env bash -ex
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
YW=`echo "\033[33m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
RETRY_NUM=10
|
||||
RETRY_EVERY=3
|
||||
NUM=$RETRY_NUM
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
|
||||
echo -en "${GN} Setting up Container OS... "
|
||||
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 "Setting up Container OS "
|
||||
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
|
||||
locale-gen >/dev/null
|
||||
while [ "$(hostname -I)" = "" ]; do
|
||||
@ -45,29 +37,26 @@ while [ "$(hostname -I)" = "" ]; do
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo -e "${CM}${CL} \r"
|
||||
echo -en "${GN} Network Connected: ${BL}$(hostname -I)${CL} "
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Set up Container OS"
|
||||
msg_ok "Network Connected: ${BL}$(hostname -I)"
|
||||
|
||||
echo -en "${GN} Updating Container OS... "
|
||||
apt-get update &>/dev/null
|
||||
msg_info "Updating Container OS"
|
||||
apt update &>/dev/null
|
||||
apt-get -qqy upgrade &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Updated Container OS"
|
||||
|
||||
echo -en "${GN} Installing Dependencies... "
|
||||
apt-get update &>/dev/null
|
||||
apt-get -qqy install \
|
||||
curl \
|
||||
sudo &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_info "Installing Dependencies"
|
||||
apt-get install -y curl &>/dev/null
|
||||
apt-get install -y sudo &>/dev/null
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
echo -en "${GN} Installing Pi-hole... "
|
||||
msg_info "Installing Pi-hole"
|
||||
curl -sSL https://install.pi-hole.net | bash
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Installed Pi-hole"
|
||||
|
||||
PASS=$(grep -w "root" /etc/shadow | cut -b6);
|
||||
if [[ $PASS != $ ]]; then
|
||||
echo -en "${GN} Customizing Container... "
|
||||
msg_info "Customizing Container"
|
||||
rm /etc/motd
|
||||
rm /etc/update-motd.d/10-uname
|
||||
touch ~/.hushlogin
|
||||
@ -80,11 +69,11 @@ ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,3840
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Customized Container"
|
||||
fi
|
||||
|
||||
echo -en "${GN} Cleanup... "
|
||||
msg_info "Cleaning up"
|
||||
apt-get autoremove >/dev/null
|
||||
apt-get autoclean >/dev/null
|
||||
rm -rf /var/{cache,log}/* /var/lib/apt/lists/*
|
||||
echo -e "${CM}${CL} \n"
|
||||
msg_ok "Cleaned"
|
||||
|
@ -1,38 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env bash -ex
|
||||
#https://community.ui.com/questions/UniFi-Installation-Scripts-or-UniFi-Easy-Update-Script-or-UniFi-Lets-Encrypt-or-UniFi-Easy-Encrypt-/ccbc7530-dd61-40a7-82ec-22b17f027776
|
||||
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
|
||||
trap 'die "Script interrupted."' INT
|
||||
|
||||
function error_exit() {
|
||||
trap - ERR
|
||||
local DEFAULT='Unknown failure occured.'
|
||||
local REASON="\e[97m${1:-$DEFAULT}\e[39m"
|
||||
local FLAG="\e[91m[ERROR:LXC] \e[93m$EXIT@$LINE"
|
||||
msg "$FLAG $REASON"
|
||||
exit $EXIT
|
||||
}
|
||||
function msg() {
|
||||
local TEXT="$1"
|
||||
echo -e "$TEXT"
|
||||
}
|
||||
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
YW=`echo "\033[33m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
RETRY_NUM=10
|
||||
RETRY_EVERY=3
|
||||
NUM=$RETRY_NUM
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
|
||||
echo -en "${GN} Setting up Container OS... "
|
||||
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 "Setting up Container OS "
|
||||
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
|
||||
locale-gen >/dev/null
|
||||
while [ "$(hostname -I)" = "" ]; do
|
||||
@ -45,27 +38,26 @@ while [ "$(hostname -I)" = "" ]; do
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo -e "${CM}${CL} \r"
|
||||
echo -en "${GN} Network Connected: ${BL}$(hostname -I)${CL} "
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Set up Container OS"
|
||||
msg_ok "Network Connected: ${BL}$(hostname -I)"
|
||||
|
||||
echo -en "${GN} Updating Container OS... "
|
||||
msg_info "Updating Container OS"
|
||||
apt update &>/dev/null
|
||||
apt-get -qqy upgrade &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Updated Container OS"
|
||||
|
||||
echo -en "${GN} Installing Dependencies... "
|
||||
msg_info "Installing Dependencies"
|
||||
apt-get install -y curl &>/dev/null
|
||||
apt-get install -y sudo &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
echo -en "${GN} Installing UniFi Network Application... "
|
||||
msg_info "Installing UniFi Network Application"
|
||||
wget -qL https://get.glennr.nl/unifi/install/install_latest/unifi-latest.sh && bash unifi-latest.sh --skip &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Installed UniFi Network Application"
|
||||
|
||||
PASS=$(grep -w "root" /etc/shadow | cut -b6);
|
||||
if [[ $PASS != $ ]]; then
|
||||
echo -en "${GN} Customizing Container... "
|
||||
msg_info "Customizing Container"
|
||||
rm /etc/motd
|
||||
rm /etc/update-motd.d/10-uname
|
||||
touch ~/.hushlogin
|
||||
@ -78,11 +70,11 @@ ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,3840
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
|
||||
echo -e "${CM}${CL} \r"
|
||||
msg_ok "Customized Container"
|
||||
fi
|
||||
|
||||
echo -en "${GN} Cleanup... "
|
||||
msg_info "Cleaning up"
|
||||
apt-get autoremove >/dev/null
|
||||
apt-get autoclean >/dev/null
|
||||
rm -rf /var/{cache,log}/* /var/lib/apt/lists/*
|
||||
echo -e "${CM}${CL} \n"
|
||||
msg_ok "Cleaned"
|
||||
|
Loading…
Reference in New Issue
Block a user