diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000..4cf8cff5
--- /dev/null
+++ b/.github/CODE_OF_CONDUCT.md
@@ -0,0 +1,132 @@
+
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, religion, or sexual identity
+and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming,
+diverse, inclusive, and healthy community.
+
+## Our Standards
+
+Examples of behavior that contributes to a positive environment for our
+community include:
+
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes,
+ and learning from the experience
+* Focusing on what is best not just for us as individuals, but for the
+ overall community
+
+Examples of unacceptable behavior include:
+
+* The use of sexualized language or imagery, and sexual attention or
+ advances of any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or email
+ address, without their explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Enforcement Responsibilities
+
+Community leaders are responsible for clarifying and enforcing our standards of
+acceptable behavior and will take appropriate and fair corrective action in
+response to any behavior that they deem inappropriate, threatening, offensive,
+or harmful.
+
+Community leaders have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, and will communicate reasons for moderation
+decisions when appropriate.
+
+## Scope
+
+This Code of Conduct applies within all community spaces, and also applies when
+an individual is officially representing the community in public spaces.
+Examples of representing our community include using an official e-mail address,
+posting via an official social media account, or acting as an appointed
+representative at an online or offline event.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported to the community leaders responsible for enforcement.
+All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the
+reporter of any incident.
+
+## Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining
+the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing
+clarity around the nature of the violation and an explanation of why the
+behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
+
+**Community Impact**: A violation through a single incident or series
+of actions.
+
+**Consequence**: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction with
+those enforcing the Code of Conduct, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external channels
+like social media. Violating these terms may lead to a temporary or
+permanent ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including
+sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No public or
+private interaction with the people involved, including unsolicited interaction
+with those enforcing the Code of Conduct, is allowed during this period.
+Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior, harassment of an
+individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within
+the community.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 2.0, available at
+[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
+
+Community Impact Guidelines were inspired by
+[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
+
+For answers to common questions about this code of conduct, see the FAQ at
+[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
+at [https://www.contributor-covenant.org/translations][translations].
+
+[homepage]: https://www.contributor-covenant.org
+[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
+[Mozilla CoC]: https://github.com/mozilla/diversity
+[FAQ]: https://www.contributor-covenant.org/faq
+[translations]: https://www.contributor-covenant.org/translations
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
new file mode 100644
index 00000000..2f938e25
--- /dev/null
+++ b/.github/CONTRIBUTING.md
@@ -0,0 +1,5 @@
+# Contributing to Proxmox Helper Scripts
+
+Everybody is invited and welcome to contribute to Proxmox Helper Scripts.
+
+- Pull requests are always created against the [**pull-requests**](https://github.com/tteck/Proxmox/tree/pull-requests) branch.
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 00000000..8ecf7b04
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1 @@
+ko_fi: proxmoxhelperscripts
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 00000000..dae485c8
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,16 @@
+---
+name: Bug report
+about: Create a report to help us improve (script related)
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+**Describe the issue**
+A clear and concise description of what the bug is.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**Bug reports will be closed after 12 hours of NO activity.**
diff --git a/.github/ISSUE_TEMPLATE/feature-script-request.md b/.github/ISSUE_TEMPLATE/feature-script-request.md
new file mode 100644
index 00000000..ddcfa3a4
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature-script-request.md
@@ -0,0 +1,11 @@
+---
+name: Feature/Script Request
+about: Suggest an idea for this project in Discussions
+title: Please submit feature/script requests in Discussions
+labels: Feature Request
+assignees: tteck
+
+---
+
+Please submit feature/script requests in Discussions
+https://github.com/tteck/Proxmox/discussions
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 00000000..ad7ef3fc
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,16 @@
+# All Pull Requests should be made to the `pull-requests` branch
+
+## Description
+
+Please include a summary of the change and/or which issue is fixed.
+
+Fixes # (issue)
+
+## Type of change
+
+Please delete options that are not relevant.
+
+- [ ] Bug fix
+- [ ] New feature
+- [ ] New Script
+- [ ] This change requires a documentation update
diff --git a/CHANGELOG.MD b/CHANGELOG.MD
index 0f87091b..b932261a 100644
--- a/CHANGELOG.MD
+++ b/CHANGELOG.MD
@@ -1,8 +1,606 @@
-
-
+
# Change Log
All notable changes to this project will be documented in this file.
+## 2023-03-10
+
+### Changed
+
+- **Proxmox LXC Updater**
+ - You can use the command line to exclude multiple containers simultaneously.
+
+## 2023-03-08
+
+### Changed
+
+- **Proxmox CPU Scaling Governor**
+ - Menu options dynamically based on the available scaling governors.
+
+## 2023-03-07
+
+### Changed
+
+- **Alpine-Vaultwarden LXC**
+ - NEW Script
+- **All LXC Scripts**
+ - Retrieve the time zone from Proxmox and configure the container to use the same time zone
+
+## 2023-02-24
+
+### Changed
+
+- **qBittorrent LXC** (Thanks @romka777)
+ - NEW Script
+- **Jackett LXC** (Thanks @romka777)
+ - NEW Script
+
+## 2023-02-23
+
+### Changed
+
+- **Proxmox LXC Updater**
+ - Skip all templates, allowing for the starting, updating, and shutting down of containers to be resumed automatically.
+ - Exclude an additional container by adding the CTID at the end of the shell command ( -s 103).
+
+## 2023-02-16
+
+### Changed
+
+- **RSTPtoWEB LXC**
+ - NEW Script
+- **go2rtc LXC**
+ - NEW Script
+
+## 2023-02-12
+
+### Changed
+
+- **OliveTin**
+ - NEW Script
+
+## 2023-02-10
+
+### Changed
+
+- **Home Assistant OS VM**
+ - Code Refactoring
+
+## 2023-02-05
+
+### Changed
+
+- **Devuan LXC**
+ - NEW Script
+
+## 2023-02-02
+
+### Changed
+
+- **Audiobookshelf LXC**
+ - NEW Script
+- **Rocky Linux LXC**
+ - NEW Script
+
+## 2023-01-28
+
+### Changed
+
+- **LXC Cleaner**
+ - Code refactoring to give the user the option to choose whether cache or logs will be deleted for each app/service.
+ - Leaves directory structure intact
+
+## 2023-01-27
+
+### Changed
+
+- **LXC Cleaner**
+ - NEW Script
+
+## 2023-01-26
+
+### Changed
+
+- **ALL LXC's**
+ - Add an option to disable IPv6 (Advanced)
+
+## 2023-01-25
+
+### Changed
+
+- **Home Assistant OS VM**
+ - switch to v5
+ - add an option to set MTU size (Advanced)
+ - add arch check (no ARM64) (issue from community.home-assistant.io)
+ - add check to insure VMID isn't already used before VM creation (Advanced) (issue from forum.proxmox.com)
+ - code refactoring
+- **PiMox Home Assistant OS VM**
+ - switch to v5
+ - add an option to set MTU size (Advanced)
+ - add arch check (no AMD64)
+ - add pve check (=>7.2)
+ - add check to insure VMID isn't already used before VM creation (Advanced)
+ - code refactoring
+- **All LXC's**
+ - add arch check (no ARM64) (issue from forum.proxmox.com)
+
+## 2023-01-24
+
+### Changed
+
+- **Transmission LXC**
+ - NEW Script
+
+## 2023-01-23
+
+### Changed
+
+- **ALL LXC's**
+ - Add [Midnight Commander (mc)](https://www.linuxcommand.org/lc3_adv_mc.php)
+
+## 2023-01-22
+
+### Changed
+
+- **Autobrr LXC**
+ - NEW Script
+
+## 2023-01-21
+
+### Changed
+
+- **Kavita LXC**
+ - NEW Script
+
+## 2023-01-19
+
+### Changed
+
+- **SABnzbd LXC**
+ - NEW Script
+
+## 2023-01-17
+
+### Changed
+
+- **Homer LXC**
+ - NEW Script
+
+## 2023-01-14
+
+### Changed
+
+- **Tdarr LXC**
+ - NEW Script
+- **Deluge LXC**
+ - NEW Script
+
+## 2023-01-13
+
+### Changed
+
+- **Lidarr LXC**
+ - NEW Script
+- **Prowlarr LXC**
+ - NEW Script
+- **Radarr LXC**
+ - NEW Script
+- **Readarr LXC**
+ - NEW Script
+- **Sonarr LXC**
+ - NEW Script
+- **Whisparr LXC**
+ - NEW Script
+
+## 2023-01-12
+
+### Changed
+
+- **ALL LXC's**
+ - Add an option to set MTU size (Advanced)
+
+## 2023-01-11
+
+### Changed
+
+- **Home Assistant Core LXC**
+ - Auto Initialize
+- **Cronicle Primary/Worker LXC**
+ - NEW Script
+
+## 2023-01-09
+
+### Changed
+
+- **ALL LXC's**
+ - v5
+- **k0s Kubernetes LXC**
+ - NEW Script
+- **Podman LXC**
+ - NEW Script
+
+## 2023-01-04
+
+### Changed
+
+- **YunoHost LXC**
+ - NEW Script
+
+## 2022-12-31
+
+### Changed
+
+- **v5 Scripts** (Testing before moving forward https://github.com/tteck/Proxmox/discussions/881)
+ - Adguard Home LXC
+ - Docker LXC
+ - Home Assistant Core LXC
+ - PhotoPrism LXC
+ - Shinobi NVR LXC
+ - Vaultwarden LXC
+
+## 2022-12-27
+
+### Changed
+
+- **Home Assistant Container LXC**
+ - Add an option to use Fuse Overlayfs (ZFS) (Advanced)
+
+- **Docker LXC**
+ - Add an option to use Fuse Overlayfs (ZFS) (Advanced)
+ - If the LXC is created Privileged, the script will automatically set up USB passthrough.
+
+## 2022-12-22
+
+### Changed
+
+- **All LXC's**
+ - Add an option to run the script in Verbose Mode (Advanced)
+
+## 2022-12-20
+
+### Changed
+
+- **Hyperion LXC**
+ - NEW Script
+
+## 2022-12-17
+
+### Changed
+
+- **Home Assistant Core LXC**
+ - Linux D-Bus Message Broker
+ - Mariadb & PostgreSQL Ready
+ - Bluetooth Ready
+ - Fix for Inconsistent Dependency Versions (dbus-fast & bleak)
+
+## 2022-12-16
+
+### Changed
+
+- **Home Assistant Core LXC**
+ - Python 3.10.8
+
+## 2022-12-09
+
+### Changed
+
+- **Change Detection LXC**
+ - NEW Script
+
+## 2022-12-03
+
+### Changed
+
+- **All LXC's**
+ - Add options to set DNS Server IP Address and DNS Search Domain (Advanced)
+
+## 2022-11-27
+
+### Changed
+
+- **Shinobi LXC**
+ - NEW Script
+
+## 2022-11-24
+
+### Changed
+
+- **Home Assistant OS VM**
+ - Add option to set machine type during VM creation (Advanced)
+
+## 2022-11-23
+
+### Changed
+
+- **All LXC's**
+ - Add option to enable root ssh access during LXC creation (Advanced)
+
+## 2022-11-21
+
+### Changed
+
+- **Proxmox LXC Updater**
+ - Now updates Ubuntu, Debian, Devuan, Alpine Linux, CentOS-Rocky-Alma, Fedora, ArchLinux [(@Uruknara)](https://github.com/tteck/Proxmox/commits?author=Uruknara)
+
+## 2022-11-13
+
+### Changed
+
+- **All LXC's**
+ - Add option to continue upon Internet NOT Connected
+
+## 2022-11-11
+
+### Changed
+
+- **HA Bluetooth Integration Preparation**
+ - [NEW Script](https://github.com/tteck/Proxmox/discussions/719)
+
+## 2022-11-04
+
+### Changed
+
+- **Scrypted LXC**
+ - NEW Script
+
+## 2022-11-01
+
+### Changed
+
+- **Alpine LXC**
+ - NEW Script
+- **Arch LXC**
+ - NEW Script
+
+## 2022-10-27
+
+### Changed
+
+- **Container & Core Restore from Backup**
+ - [NEW Scripts](https://github.com/tteck/Proxmox/discussions/674)
+
+## 2022-10-07
+
+### Changed
+
+- **Home Assistant OS VM**
+ - Add "Latest" Image
+
+## 2022-10-05
+
+### Changed
+
+- **Umbrel LXC**
+ - NEW Script (Docker)
+- **Blocky LXC**
+ - NEW Script (Adblocker - DNS)
+
+## 2022-09-29
+
+### Changed
+
+- **Home Assistant Container LXC**
+ - If the LXC is created Privileged, the script will automatically set up USB passthrough.
+- **Home Assistant Core LXC**
+ - NEW Script
+- **PiMox HAOS VM**
+ - NEW Script
+
+## 2022-09-23
+
+### Changed
+
+- **EMQX LXC**
+ - NEW Script
+
+## 2022-09-22
+
+### Changed
+
+- **NextCloudPi LXC**
+ - NEW Script
+
+## 2022-09-21
+
+### Changed
+
+- **Proxmox Backup Server Post Install**
+ - NEW Script
+- **Z-wave JS UI LXC**
+ - NEW Script (and all sub scripts 🤞)
+- **Zwave2MQTT LXC**
+ - Bye Bye Script
+
+## 2022-09-20
+
+### Changed
+
+- **OpenMediaVault LXC**
+ - NEW Script
+
+## 2022-09-16
+
+### Changed
+
+- **Paperless-ngx LXC**
+ - NEW Script (Thanks @Donkeykong307)
+
+## 2022-09-11
+
+### Changed
+
+- **Trilium LXC**
+ - NEW Script
+
+## 2022-09-10
+
+### Changed
+
+- **Syncthing LXC**
+ - NEW Script
+
+## 2022-09-09
+
+### Changed
+
+- **CasaOS LXC**
+ - NEW Script
+- **Proxmox Kernel Clean**
+ - Now works with Proxmox Backup Server
+
+## 2022-09-08
+
+### Changed
+
+- **Navidrome LXC**
+ - NEW Script
+- **Homepage LXC**
+ - NEW Script
+
+## 2022-08-31
+
+### Changed
+
+- **All LXC's**
+ - Add Internet & DNS Check
+
+## 2022-08-22
+
+### Changed
+
+- **Wiki.js LXC**
+ - NEW Script
+- **Emby Media Server LXC**
+ - NEW Script
+
+## 2022-08-20
+
+### Changed
+
+- **Mikrotik RouterOS VM**
+ - NEW Script
+
+## 2022-08-19
+
+### Changed
+
+- **PhotoPrism LXC**
+ - Fixed .env bug (Thanks @cklam2)
+
+## 2022-08-13
+
+### Changed
+
+- **Home Assistant OS VM**
+ - Option to create VM using Stable, Beta or Dev Image
+
+## 2022-08-11
+
+### Changed
+
+- **Home Assistant OS VM**
+ - Validate Storage
+
+## 2022-08-04
+
+### Changed
+
+- **VS Code Server**
+ - NEW Script
+
+## 2022-08-02
+
+### Changed
+
+- **All LXC/VM**
+ - v4 Script - Whiptail menu's
+
+## 2022-07-26
+
+### Changed
+
+- **Home Assistant OS VM**
+ - Set the real time clock (RTC) to local time.
+ - Disable the USB tablet device (save resources / not needed).
+
+## 2022-07-24
+
+### Changed
+
+- **Home Assistant OS VM**
+ - Present the drive to the guest as a solid-state drive rather than a rotational hard disk. There is no requirement that the underlying storage actually be backed by SSD's.
+ - When the VM’s filesystem marks blocks as unused after deleting files, the SCSI controller will relay this information to the storage, which will then shrink the disk image accordingly.
+ - 👉 [more info](https://github.com/tteck/Proxmox/discussions/378)
+
+## 2022-07-22
+
+### Changed
+
+- **n8n LXC** (thanks to @cyakimov)
+ - NEW Script
+
+## 2022-07-21
+
+### Changed
+
+- **grocy LXC**
+ - NEW Script
+
+## 2022-07-17
+
+### Changed
+
+- **Vaultwarden LXC**
+ - NEW Vaultwarden Update (post 2022-05-29 installs only) Script
+ - NEW Web-vault Update (any) Script
+
+## 2022-07-14
+
+### Changed
+
+- **MagicMirror Server LXC**
+ - NEW Script
+
+## 2022-07-13
+
+### Changed
+
+- **Proxmox Edge Kernel Tool**
+ - NEW Script
+
+## 2022-07-11
+
+### Changed
+
+- **Home Assistant OS VM**
+ - Supports lvmthin, zfspool, nfs, dir and btrfs storage types.
+
+## 2022-07-08
+
+### Changed
+
+- **openHAB LXC**
+ - NEW Script
+
+## 2022-07-03
+
+### Changed
+
+- **Tailscale**
+ - NEW Script
+
+## 2022-07-01
+
+### Changed
+
+- **Home Assistant OS VM**
+ - Allow different storage types (lvmthin, nfs, dir).
+
+## 2022-06-30
+
+### Changed
+
+- **Prometheus LXC**
+ - NEW Script
## 2022-06-06
diff --git a/LICENSE b/LICENSE
index b3b9c59c..733d43ad 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2021 tteck
+Copyright (c) 2021-2023 tteck
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 1a604360..acdc8c2d 100644
--- a/README.md
+++ b/README.md
@@ -1,1744 +1,4 @@
-
Select a Proxmox Helper
- Always remember to use due diligence when sourcing scripts and automation tasks from third-party sites.
+These script's allows for the creation of a Linux container or virtual machine in an interactive manner, with options for both basic and advanced configurations. The basic setup uses default settings, while the advanced setup provides additional options such as container type, root password, hostname, disk size, core count, RAM size, network settings, and others. The options are presented in a dialog box format using the whiptail command and the script collects and validates the user's input to generate the final configuration of the container or virtual machine.
-
🔸
-
-
- Proxmox VE 7 Post Install
-
-
-
- Proxmox VE 7 Post Install
-
-This script will give options to Disable the Enterprise Repo, Add/Correct PVE7 Sources, Enable the No-Subscription Repo, Add Test Repo and Disable Subscription Nag.
-
-Run the following in the Proxmox Shell. ⚠️ **PVE7 ONLY**
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/post-install-v3.sh)"
-```
-
-It's recommended to update Proxmox after running this script, before adding any VM/CT.
-
-____________________________________________________________________________________________
-
-
-
-
- Proxmox Kernel Clean
-
-
-
-Proxmox Kernel Clean
-
-Cleaning unused kernel images is not only good because of a reduced grub menu, but also gains some disk space.
-
-Run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/kernel-clean-v3.sh)"
-```
-____________________________________________________________________________________________
-
-
-
-
- Proxmox CPU Scaling Governor
-
-
-
-Proxmox CPU Scaling Governor
-
-CPU Scaling Governor enables the operating system to scale the CPU frequency up or down in order to save power or improve performance.
-
-[Generic Scaling Governors](https://www.kernel.org/doc/html/latest/admin-guide/pm/cpufreq.html?#generic-scaling-governors)
-
-Run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/scaling-governor.sh)"
-```
-____________________________________________________________________________________________
-
-
-
-
- Proxmox LXC Updater
-
-
-
-Proxmox LXC Updater
-
-Update All LXC's Fast & Easy
-
-Run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/update-lxcs.sh)"
-```
-____________________________________________________________________________________________
-
-
-
-
- Proxmox Dark Theme
-
-
-
- Proxmox Discord Dark Theme
-
-A dark theme for the Proxmox Web UI by [Weilbyte](https://github.com/Weilbyte/PVEDiscordDark)
-
-Run the following in the Proxmox Shell.
-
-```yaml
-bash <(curl -s https://raw.githubusercontent.com/Weilbyte/PVEDiscordDark/master/PVEDiscordDark.sh ) install
-```
-
-To uninstall the theme, simply run the script with the `uninstall` command.
-
-____________________________________________________________________________________________
-
-
-
-
-
- Home Assistant OS VM
-
-
-
- Home Assistant OS VM
- Option to create VM using the Latest or Stable Image
-
-To create a new Proxmox Home Assistant OS VM, run the following in the Proxmox Shell
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/vm/haos-vm-v3.sh)"
-```
-⚡ Default Settings: 4GB RAM - 32GB Storage - 2vCPU - Stable Image⚡
-
-After the script completes, click on the VM, then on the **_Summary_** tab to find the VM IP.
-
-**Home Assistant Interface - IP:8123**
-
-____________________________________________________________________________________________
-
-
-
-
-
- Home Assistant Container LXC
-
-
-

-
- Home Assistant Container LXC
-
-To create a new Proxmox Home Assistant Container LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/homeassistant-v3.sh)"
-```
-
-⚡ Default Settings: 2GB RAM - 16GB Storage - 2vCPU ⚡
-
-**Home Assistant Interface - IP:8123**
-
-**Portainer Interface - IP:9000**
-
-⚙️ **Path to HA /config**
-```yaml
-/var/lib/docker/volumes/hass_config/_data
- ```
-⚙️ **To Edit the HA configuration.yaml** (Recommend Using File Browser)
-
-Run in the LXC console
-```yaml
-nano /var/lib/docker/volumes/hass_config/_data/configuration.yaml
-```
-Save and exit the editor with “Ctrl+O”, “Enter” and “Ctrl+X”
-
-⚙️ **Copy Data From a Existing Home Assistant LXC to another Home Assistant LXC**
-
-Run in the Proxmox Shell
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/ha-copy-data.sh)"
- ```
-
-⚙️ **To Allow USB Device Passthrough:**
-
-Run in the Proxmox Shell. (**replace `106` with your LXC ID**)
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/usb-passthrough.sh)" -s 106
-```
-
-Reboot the LXC to apply the changes
-
-
-⚙️ **To Install HACS:**
-
-Run in the LXC console
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/hacs.sh)"
-```
-After install, reboot Home Assistant and **clear browser cache** then Add HACS integration.
-
-
-⚙️ [**Update Menu**](https://raw.githubusercontent.com/tteck/Proxmox/main/misc/images/update-menu.png)
-
-Run in the LXC console
-```yaml
-./update
-```
-____________________________________________________________________________________________
-
-
-
- Podman Home Assistant Container LXC
-
-
-
![]()

![]()
-
- Podman Home Assistant Container LXC
-To create a new Proxmox Podman Home Assistant Container LXC, run the following in the Proxmox Shell.
-
- ([What is Podman?](https://youtu.be/lkg5QJsoCCQ)) ⚠️ Podman seems to need a privileged LXC
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/podman-homeassistant-v3.sh)"
-```
-⚡ Default Settings: 2GB RAM - 16GB Storage - 2vCPU ⚡
-
-**Home Assistant Interface - IP:8123**
-
-**Yacht Interface - IP:8000**
-
-⚙️ **Path to HA /config**
-```yaml
-/var/lib/containers/storage/volumes/hass_config/_data
- ```
-⚙️ **To edit the HA configuration.yaml**
-
-Run in the LXC console
-```yaml
-nano /var/lib/containers/storage/volumes/hass_config/_data/configuration.yaml
-```
-Save and exit the editor with “Ctrl+O”, “Enter” and “Ctrl+X”
-
-⚙️ **Copy Data From a Existing Home Assistant LXC to a Podman Home Assistant LXC**
-
-Run in the Proxmox Shell
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/ha-copy-data-podman.sh)"
- ```
-
-⚙️ **To allow USB device passthrough:**
-
-Run in the Proxmox Shell. (**replace `106` with your LXC ID**)
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/usb-passthrough.sh)" -s 106
-```
-
-Reboot the LXC to apply the changes
-
-⚙️ **To Install HACS:**
-
-Run in the LXC console
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/podman_hacs.sh)"
-```
-After install, reboot Home Assistant and **clear browser cache** then Add HACS integration.
-
-⚙️ **Initial Yacht Login**
-
-**username**
- ```yaml
- admin@yacht.local
- ```
- **password**
- ```yaml
- pass
- ```
-
-____________________________________________________________________________________________
-
-
-
- ioBroker LXC
-
-
-
- ioBroker LXC
-
-[ioBroker](https://www.iobroker.net/#en/intro) is an open source automation platform.
-
-To create a new Proxmox ioBroker LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/iobroker-v3.sh)"
-```
-
-⚡ Default Settings: 2GB RAM - 8GB Storage - 2vCPU ⚡
-
-**ioBroker Interface - IP:8081**
-
-⚙️ **To Update ioBroker**
-
-```yaml
-update from the ioBroker UI
-```
-
-____________________________________________________________________________________________
-
-
-
-
- Homebridge LXC
-
-
-
- Homebridge LXC
-Homebridge allows you to integrate with smart home devices that do not natively support HomeKit
-
-To create a new Proxmox Homebridge LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/homebridge-v3.sh)"
-```
-
-⚡ Default Settings: 1GB RAM - 4GB Storage - 1vCPU ⚡
-
-**Homebridge Interface - IP:8581**
-
-⚙️ **Initial Login**
-
-**username**
- ```yaml
- admin
- ```
- **password**
- ```yaml
- admin
- ```
-Config File Path `/var/lib/homebridge/config.json`
-
-Storage Path `/var/lib/homebridge`
-
-Restart Command `sudo hb-service restart`
-
-Stop Command `sudo hb-service stop`
-
-Start Command `sudo hb-service start`
-
-View Logs Command `sudo hb-service logs`
-
-Systemd Service File `/etc/systemd/system/homebridge.service`
-
-Systemd Env File `/etc/default/homebridge`
-
-⚙️ **To Update Homebridge**
-
-```yaml
-Update from the Homebridge UI
-```
-
- ___________________________________________________________________________________________
-
-
-
-
-
-
- ESPHome LXC
-
-
-
- ESPHome LXC
-
-To create a new Proxmox ESPHome LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/esphome-v3.sh)"
-```
-
-⚡ Default Settings: 1GB RAM - 4GB Storage - 2vCPU ⚡
-
-**ESPHome Interface - IP:6052**
-
-⚙️ **To Update ESPHome**
-
-Run in the LXC console
-```yaml
-pip3 install esphome --upgrade
-```
-
-____________________________________________________________________________________________
-
-
-
-
-
-
- Nginx Proxy Manager LXC
-
-
-
-
- Nginx Proxy Manager LXC
-
-To create a new Proxmox Nginx Proxy Manager LXC Container, run the following in the Proxmox Shell.
-
-```yaml
- bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/nginx-proxy-manager-v3.sh)"
-```
-⚡ Default Settings: 1GB RAM - 3GB Storage - 1vCPU ⚡
-
-____________________________________________________________________________________
-
-Forward port `80` and `443` from your router to your Nginx Proxy Manager LXC IP.
-
-Add the following to your `configuration.yaml` in Home Assistant.
-```yaml
- http:
- use_x_forwarded_for: true
- trusted_proxies:
- - 192.168.100.27 ###(Nginx Proxy Manager LXC IP)###
-```
-
-**Nginx Proxy Manager Interface - IP:81**
-
-⚙️ **Initial Login**
-
-**username**
- ```yaml
- admin@example.com
- ```
- **password**
- ```yaml
- changeme
- ```
-⚙️ **To Update Nginx Proxy Manager**
-
-Run in the LXC console
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/npm_update.sh)"
-```
-
- ____________________________________________________________________________________________
-
-
-
-
- MQTT LXC
-
-
-
-
- MQTT LXC
-
-To create a new Proxmox MQTT LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/mqtt-v3.sh)"
-```
-
-⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡
-
-Mosquitto comes with a password file generating utility called mosquitto_passwd.
-```yaml
-sudo mosquitto_passwd -c /etc/mosquitto/passwd
-```
-Password: < password >
-
-Create a configuration file for Mosquitto pointing to the password file we have just created.
-```yaml
-sudo nano /etc/mosquitto/conf.d/default.conf
-```
-This will open an empty file. Paste the following into it.
-```yaml
-allow_anonymous false
-persistence true
-password_file /etc/mosquitto/passwd
-listener 1883
-```
-Save and exit the text editor with "Ctrl+O", "Enter" and "Ctrl+X".
-
-Now restart Mosquitto server.
-```yaml
-sudo systemctl restart mosquitto
-```
-
-⚙️ **To Update MQTT:**
-
-Run in the LXC console
-```yaml
-apt update && apt upgrade -y
-```
-
-____________________________________________________________________________________________
-
-
-
-
- Node-Red LXC
-
-
-
- Node-Red LXC
-
-
-To create a new Proxmox Node-RED LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/node-red-v3.sh)"
-```
-
-⚡ Default Settings: 1GB RAM - 4GB Storage - 1vCPU ⚡
-
-**Node-Red Interface - IP:1880**
-
-⚙️ **To Restart Node-Red:**
-
-Run in the LXC console
-```yaml
-node-red-restart
-```
-
-⚙️ **To Update Node-Red:**
-
-Run in the LXC console (Restart after update)
-```yaml
-npm install -g --unsafe-perm node-red
-```
-
-⚙️ **To Install Node-Red Themes** ⚠️ **Backup your flows before running this script!!**
-
-Run in the LXC console
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/node-red-themes.sh)"
-```
-
-____________________________________________________________________________________________
-
-
-
-
- Mariadb LXC
-
-

-
- Mariadb LXC
-
-To create a new Proxmox Mariadb LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/mariadb-v3.sh)"
-```
-
-⚡ Default Settings: 1GB RAM - 4GB Storage - 1vCPU ⚡
-
-To enable MariaDB to listen to remote connections, you need to edit your defaults file. To do this, open the console in your MariaDB lxc:
-```yaml
-nano /etc/mysql/my.cnf
-```
-Un-comment `port =3306`
-Save and exit the editor with "Ctrl+O", "Enter" and "Ctrl+X".
-
-```yaml
-nano /etc/mysql/mariadb.conf.d/50-server.cnf
-```
-Comment `bind-address = 127.0.0.1`
-Save and exit the editor with "Ctrl+O", "Enter" and "Ctrl+X".
-
-For new MariaDB installations, the next step is to run the included security script. This script changes some of the less secure default options. We will use it to block remote root logins and to remove unused database users.
-
-Run the security script:
-```yaml
-sudo mysql_secure_installation
-```
-Enter current password for root (enter for none): `enter`
-
-Switch to unix_socket authentication [Y/n] `y`
-
-Change the root password? [Y/n] `n`
-
-Remove anonymous users? [Y/n] `y`
-
-Disallow root login remotely? [Y/n] `y`
-
-Remove test database and access to it? [Y/n] `y`
-
-Reload privilege tables now? [Y/n] `y`
-
-We will create a new account called admin with the same capabilities as the root account, but configured for password authentication.
-```yaml
-sudo mysql
-```
-Prompt will change to ```MariaDB [(none)]>```
-
-Create a new local admin (Change the username and password to match your preferences)
-```yaml
-CREATE USER 'admin'@'localhost' IDENTIFIED BY 'password';
-```
-Give local admin root privileges (Change the username and password to match above)
-```yaml
-GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
-```
-
-Now, we'll give the user admin root privileges and password-based access that can connect from anywhere on your local area network (LAN), which has addresses in the subnet 192.168.100.0/24. This is an improvement because opening a MariaDB server up to the Internet and granting access to all hosts is bad practice.. Change the **_username_**, **_password_** and **_subnet_** to match your preferences:
-```yaml
-GRANT ALL ON *.* TO 'admin'@'192.168.100.%' IDENTIFIED BY 'password' WITH GRANT OPTION;
-```
-Flush the privileges to ensure that they are saved and available in the current session:
-```yaml
-FLUSH PRIVILEGES;
-```
-Following this, exit the MariaDB shell:
-```yaml
-exit
-```
-Log in as the new database user you just created:
-```yaml
-mysql -u admin -p
-```
-Create a new database:
-```yaml
-CREATE DATABASE homeassistant;
-```
-Following this, exit the MariaDB shell:
-```yaml
-exit
-```
-⚠️ Reboot the lxc
-
-Checking status.
-```yaml
-sudo systemctl status mariadb
-```
-Change the recorder: `db_url:` in your HA configuration.yaml
-
-Example: `mysql://admin:password@192.168.100.26:3306/homeassistant?charset=utf8mb4`
-
-⚙️ **To Update Mariadb:**
-
-Run in the LXC console
-```yaml
-apt update && apt upgrade -y
-```
-⚙️ [**Adminer**](https://raw.githubusercontent.com/tteck/Proxmox/main/misc/images/adminer.png) (formerly phpMinAdmin) is a full-featured database management tool
-
- `http://your-mariadb-lxc-ip/adminer/`
-
-____________________________________________________________________________________________
-
-
-
-
- PostgreSQL LXC
-
-

-
- PostgreSQL LXC
-
-To create a new Proxmox PostgreSQL LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/postgresql-v3.sh)"
-```
-
-⚡ Default Settings: 1GB RAM - 4GB Storage - 1vCPU ⚡
-
-To make sure our PostgreSQL is secured with a strong password, set a password for its system user and then change the default database admin user account
-
-Change user password
-```yaml
-passwd postgres
-```
-Login using Postgres system account
-
-```yaml
-su - postgres
-```
-Now, change the Admin database password
-```yaml
-psql -c "ALTER USER postgres WITH PASSWORD 'your-password';"
-```
-Create a new user.
-```yaml
-psql
-```
-```yaml
-CREATE USER admin WITH PASSWORD 'your-password';
-```
-Create a new database:
-```yaml
-CREATE DATABASE homeassistant;
-```
-Grant all rights or privileges on created database to the user
-```yaml
-GRANT ALL ON DATABASE homeassistant TO admin;
-```
-To exit psql
-```yaml
-\q
-```
-Then type exit to get back to root
-
-Change the recorder: `db_url:` in your HA configuration.yaml
-
-Example: `db_url: postgresql://admin:your-password@192.168.100.20:5432/homeassistant?client_encoding=utf8`
-
-⚙️ **To Update PostgreSQL**
-
-Run in the LXC console
-```yaml
-apt update && apt upgrade -y
-```
-⚙️ [**Adminer**](https://raw.githubusercontent.com/tteck/Proxmox/main/misc/images/adminer.png) (formerly phpMinAdmin) is a full-featured database management tool
-
- `http://your-PostgreSQL-lxc-ip/adminer/`
-
-____________________________________________________________________________________________
-
-
-
-
- Zigbee2MQTT LXC
-
-
-
-
-Zigbee2MQTT LXC
-
-To create a new Proxmox Zigbee2MQTT LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/zigbee2mqtt-v3.sh)"
-```
-⚡ Default Settings: 1GB RAM - 4GB Storage - 2vCPU ⚡
-
-
-⚙️ **Determine the location of your adapter**
-
-Run in the LXC console
-```yaml
-ls -l /dev/serial/by-id
-```
-Example Output: ```lrwxrwxrwx 1 root root 13 Jun 19 17:30 usb-1a86_USB_Serial-if00-port0 -> ../../ttyUSB0```
-
-
-⚙️ ⚠️ **Before you start Zigbee2MQTT you need to edit the [configuration.yaml](https://www.zigbee2mqtt.io/guide/configuration/)**
-
-Run in the LXC console
-```yaml
-nano /opt/zigbee2mqtt/data/configuration.yaml
-```
-
-Save and exit the editor with “Ctrl+O”, “Enter” and “Ctrl+X”
-
-Example:
-```yaml
-frontend:
- port: 9442
-homeassistant: true
-permit_join: false
-mqtt:
- base_topic: zigbee2mqtt
- server: 'mqtt://192.168.86.224:1883'
- user: usr
- password: pwd
- keepalive: 60
- reject_unauthorized: true
- version: 4
-serial:
- port: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
- #adapter: deconz #(uncomment for ConBee II)
-advanced:
- pan_id: GENERATE
- network_key: GENERATE
- channel: 20
-```
-⚙️ **Zigbee2MQTT can be started after completing the configuration**
-
-Run in the LXC console
-```yaml
-cd /opt/zigbee2mqtt
-npm start
-```
-⚙️ **To update Zigbee2MQTT**
-
-Run in the LXC console
- ```yaml
-cd /opt/zigbee2mqtt
-bash update.sh
- ```
-⚙️ **Copy Data From a Existing Zigbee2MQTT LXC to another Zigbee2MQTT LXC**
-
-Run in the Proxmox Shell
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/z2m-copy-data.sh)"
- ```
-
-____________________________________________________________________________________________
-
-
-
-
- deCONZ LXC
-
-
-
- deCONZ LXC
-
-To create a new Proxmox deCONZ LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/deconz-v3.sh)"
-```
-⚡ Default Settings: 1GB RAM - 4GB Storage - 2vCPU ⚡
-
-**deCONZ Interface - IP:80**
-
-⚙️ **To Update deCONZ**
-
-Run in the LXC Console
-```yaml
-apt update && apt upgrade -y
-```
-
-____________________________________________________________________________________________
-
-
-
-
- Zwavejs2MQTT LXC
-
-
-
- Zwavejs2MQTT LXC
-
-To create a new Proxmox Zwavejs2MQTT LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/zwavejs2mqtt-v3.sh)"
-```
-⚡ Default Settings: 1GB RAM - 4GB Storage - 2vCPU ⚡
-
-**Zwavejs2MQTT Interface - IP:8091**
-
-⚙️ **Copy Data From a Existing Zwavejs2MQTT LXC to another Zwavejs2MQTT LXC**
-
-Run in the Proxmox Shell
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/zwave-copy-data.sh)"
- ```
-⚙️ **To Update Zwavejs2MQTT**
-
-Run in the LXC Console
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/zwavejs2mqtt-update.sh)"
-```
-
-____________________________________________________________________________________________
-
-
-
-
- NocoDB LXC
-
-
-
- NocoDB LXC
-
-NocoDB is an open source #NoCode platform that turns any database into a smart spreadsheet. Airtable Alternative.
-
-To create a new Proxmox NocoDB LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/nocodb-v3.sh)"
-```
-
-⚡ Default Settings: 1GB RAM - 4GB Storage - 1vCPU ⚡
-
-**NocoDB Interface - IP:8080/dashboard**
-
-⚙️ **To Update NocoDB**
-
-Run in the LXC console
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/nocodb-update.sh)"
-```
-
-____________________________________________________________________________________________
-
-
-
-
- InfluxDB/Telegraf LXC
-
-
-
- InfluxDB/Telegraf LXC
-
-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-v3.sh)"
-```
-
-⚡ Default Settings: 2GB RAM - 8GB Storage - 2vCPU ⚡
-
-⚙️ **InfluxDB Configuration**
-
-Run in the LXC console
-```yaml
-nano /etc/influxdb/influxdb.conf
-```
-
-⚙️ **Telegraf Configuration**
-
-Run in the LXC console
-```yaml
-nano /etc/telegraf/telegraf.conf
-```
-
-⚙️ **To Update InfluxDB/Telegraf**
-
-Run in the LXC console
-```yaml
-apt update && apt upgrade -y
-```
-
-____________________________________________________________________________________________
-
-
-
-
- Grafana LXC
-
-
-
- Grafana LXC
-
-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-v3.sh)"
-```
-
-⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡
-
-**Grafana Interface - IP:3000**
-
-⚙️ **Initial Login**
-
-**username**
- ```yaml
- admin
- ```
- **password**
- ```yaml
- admin
- ```
-
-⚙️ **To Update Grafana**
-
-Run in the LXC console
-```yaml
-apt update && apt upgrade -y
-```
-
-____________________________________________________________________________________________
-
-
-
-
- Docker LXC
-
-
-
- Docker LXC
- Options to Install Portainer and/or Docker Compose
-
-To create a new Proxmox Docker LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/docker-v3.sh)"
-```
-
-⚡ Default Settings: 2GB RAM - 4GB Storage - 2vCPU ⚡
-
-**Portainer Interface - IP:9000**
-
-⚙️ **To Update**
-
-Run in the LXC console
-```yaml
-apt update && apt upgrade -y
-```
-
-____________________________________________________________________________________________
-
-
-
-
- Debian 11 LXC
-
-
-
- Debian 11 LXC
-
-To create a new Proxmox Debian 11 (curl. sudo) LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/debian-v3.sh)"
-```
-
-⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡
-
-⚙️ **To Update Debian 11**
-
-Run in the LXC console
-```yaml
-apt update && apt upgrade -y
-```
-
-____________________________________________________________________________________________
-
-
-
-
-
- Ubuntu LXC
-
-
-
- Ubuntu LXC
- Option to define version 18.04, 20.04, 21.10 or 22.04
-
-To create a new Proxmox Ubuntu (curl. sudo) LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/ubuntu-v3.sh)"
-```
-
-⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU - 22.04 ⚡
-
-⚙️ **To Update Ubuntu**
-
-Run in the LXC console
-```yaml
-apt update && apt upgrade -y
-```
-
-____________________________________________________________________________________________
-
-
-
-
- UniFi Network Application LXC
-
-
-
- UniFi Network Application LXC
-
- With Local Controller Option
-
-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-v3.sh)"
-```
-
-⚡ Default Settings: 2GB RAM - 8GB Storage - 2vCPU ⚡
-
-**UniFi Interface - https:// IP:8443**
-
-⚙️ **To Update UniFi**
-
-Run in the LXC console
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/unifi-update.sh)"
-```
-____________________________________________________________________________________________
-
-
-
-
- Omada Controller LXC
-
-
-
- Omada Controller LXC
-
-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-v3.sh)"
-```
-
-⚡ Default Settings: 2GB RAM - 8GB Storage - 2vCPU ⚡
-
-**Omada Interface - https:// IP:8043**
-
-`tpeap status` show status of Omada Controller
-
-`tpeap start` start Omada Controller
-
-`tpeap stop` stop Omada Controller
-
-⚙️ **To Update Omada**
-
-```yaml
-Working On
-```
-____________________________________________________________________________________________
-
-
-
-
- MeshCentral LXC
-
-
-
- MeshCentral LXC
-
-MeshCentral is a full computer management web site. With MeshCentral, you can run your own web server to remotely manage and control computers on a local network or anywhere on the internet.
-
-To create a new Proxmox MeshCentral LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/meshcentral-v3.sh)"
-```
-
-⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡
-
-**MeshCentral Interface - http:// IP**
-
-⚙️ **To Update MeshCentral**
-
-```yaml
-Update from the MeshCentral UI
-```
-____________________________________________________________________________________________
-
-
-
-
- Plex Media Server LXC
-
-
-
- Plex Media Server LXC
- With Hardware Acceleration Support
-To create a new Proxmox Plex Media Server LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/plex-v3.sh)"
-```
-⚡ Default Settings: 2GB RAM - 8GB Storage - 2vCPU ⚡
-
-**Plex Media Server Interface - IP:32400/web**
-
-⚙️ **To Update Plex Media Server:**
-
-Run in the LXC console
-```yaml
-apt update && apt upgrade -y
-```
-⚙️ **Copy Data From a Existing Plex Media Server LXC to another Plex Media Server LXC**
-
-Run in the Proxmox Shell
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/pms-copy-data.sh)"
- ```
-
-____________________________________________________________________________________________
-
-
-
-
- Jellyfin Media Server LXC
-
- Jellyfin Media Server LXC
-
-[TurnKey has a LXC CT for Jellyfin](https://www.turnkeylinux.org/mediaserver)
-
-To create a new Proxmox Jellyfin Media Server LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/jellyfin-v3.sh)"
-```
-⚡ Default Settings: 2GB RAM - 8GB Storage - 2vCPU ⚡
-
-**Jellyfin Media Server Interface - IP:8096**
-
-⚙️ **To Update Jellyfin Media Server**
-
-Run in the LXC console
-```yaml
-apt update && apt upgrade -y
-```
-____________________________________________________________________________________________
-
-
-
-
- Pi-hole LXC
-
-
-
- Pi-hole LXC
-
-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-v3.sh)"
-```
-⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡
-
-⚙️ **To set your password:**
-
-Run in the LXC console
-
-```yaml
-pihole -a -p
-```
-⚙️ **To Update Pi-hole:**
-
-```yaml
-Update from the Pi-hole UI
-```
-
-____________________________________________________________________________________________
-
-
-
-
- Technitium DNS LXC
-
-
-
- Technitium DNS LXC
-An open source authoritative as well as recursive DNS server
-
-To create a new Proxmox Technitium DNS LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/technitiumdns-v3.sh)"
-```
-
-⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡
-
-**Technitium DNS Interface - IP:5380**
-
-⚙️ **To Update Technitium DNS**
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/technitiumdns-update.sh)"
-```
-__________________________________________________________________________________________
-
-
-
-
-
- AdGuard Home LXC
-
-
-
- AdGuard Home LXC
-
-To create a new Proxmox AdGuard Home LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/adguard-v3.sh)"
-```
-
-⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡
-
-**AdGuard Home Setup Interface - IP:3000 (After Setup use only IP)**
-
- (For the Home Assistant Integration, use port `80` not `3000`)
-
-⚙️ **To Update Adguard**
-
-```yaml
-Update from the Adguard UI
-```
-__________________________________________________________________________________________
-
-
-
-
- Uptime Kuma LXC
-
-
-
- Uptime Kuma LXC
-
-Uptime Kuma is a self-hosted, open source, fancy uptime monitoring and alerting system. It can monitor HTTP(s) / TCP / HTTP(s) Keyword / Ping / DNS Record / Push / Steam Game Server.
-
-To create a new Proxmox Uptime Kuma LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/uptimekuma-v3.sh)"
-```
-
-⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡
-
-**Uptime Kuma Interface - IP:3001**
-
-⚙️ **To Update Uptime Kuma**
-
-Run in the LXC console
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/uptimekuma-update.sh)"
-```
-____________________________________________________________________________________________
-
-
-
-
- Whoogle LXC
-
-
-
- Whoogle LXC
-
-Get Google search results, but without any ads, javascript, AMP links, cookies, or IP address tracking.
-
-To create a new Proxmox Whoogle LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/whoogle-v3.sh)"
-```
-
-⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡
-
-**Whoogle Interface - IP:5000**
-
-⚙️ **To Update Whoogle**
-
-Run in the LXC console
-```yaml
-pip3 install whoogle-search --upgrade
-```
-____________________________________________________________________________________________
-
-
-
-
- Heimdall Dashboard LXC
-
-
-
- Heimdall Dashboard LXC
-
-[Heimdall Application Dashboard](https://camo.githubusercontent.com/bcfd4f74c93b25bea7b14eacbafd649206bf754a3d4b596329968f0ee569cf3c/68747470733a2f2f692e696d6775722e636f6d2f4d72433451704e2e676966) is a dashboard for all your web applications. It doesn't need to be limited to applications though, you can add links to anything you like.
-
-To create a new Proxmox Heimdall Dashboard LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/heimdalldashboard-v3.sh)"
-```
-⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡
-
-**Heimdall Dashboard Interface - IP:7990**
-
-⚙️ **To Update Heimdall Dashboard**
-
-Run in the LXC console
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/heimdalldashboard-all-update.sh)"
-```
-
-__________________________________________________________________________________________
-
-
-
-
-
- Dashy LXC
-
-
-
- Dashy LXC
-
-Dashy helps you organize your self-hosted services by making them accessible from a single place
-
-To create a new Proxmox Dashy LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/dashy-v3.sh)"
-```
-⚡ Default Settings: 2GB RAM - 3GB Storage - 2vCPU ⚡
-
-**Dashy Interface - IP:4000**
-
-After getting everything setup the way you want in interactive mode and saved to disk, you have to go into update configuration and rebuild application.
-
-⚙️ **To Update Dashy**
-
-Run in the LXC Console
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/dashy-update.sh)"
-```
-
-__________________________________________________________________________________________
-
-
-
-
-
- PhotoPrism LXC
-
-
-
- PhotoPrism LXC
-
-PhotoPrism® is an AI-powered app for browsing, organizing & sharing your photo collection.
-
-To create a new Proxmox PhotoPrism LXC, run the following in the Proxmox Shell.
-
-```
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/photoprism-v3.sh)"
-```
-
-⚡ Default Settings: 2GB RAM - 8GB Storage - 2vCPU ⚡
-
-**PhotoPrism Interface - IP:2342**
-
-⚙️ **Initial Login**
-
-**username**
- ```yaml
- admin
- ```
- **password**
- ```yaml
- admin
- ```
-[PhotoSync](https://www.photosync-app.com/home.html)
-
-⚙️ **To Update PhotoPrism**
-
-Run in the LXC Console
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/photoprism-update.sh)"
-```
-
-
-____________________________________________________________________________________________
-
-
-
-
- Daemon Sync Server LXC
-
-
-
- Daemon Sync Server LXC
-
-Sync files from app to server, share photos & videos, back up your data and stay secure inside local network.
-
-To create a new Proxmox Daemon Sync Server LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/daemonsync-v3.sh)"
-```
-
-⚡ Default Settings: 512MiB RAM - 8GB Storage - 1vCPU ⚡
-
-**Daemon Sync Server Interface - IP:8084**
-
-Search: `DAEMON Sync` in your favorite app store
-
-__________________________________________________________________________________________
-
-
-
-
- MotionEye VMS LXC
-
-
-
- MotionEye VMS LXC
-
-To create a new Proxmox MotionEye VMS LXC, run the following in the Proxmox Shell.
-
-```
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/motioneye-v3.sh)"
-```
-
-⚡ Default Settings: 2GB RAM - 8GB Storage - 2vCPU ⚡
-
-**MotionEye Interface - IP:8765**
-
-⚙️ **Initial Login**
-
-**username**
- ```yaml
- admin
- ```
- **password**
- ```yaml
-
- ```
-
-
-⚙️ **To Update MotionEye**
-
-Run in the LXC console
- ```yaml
-pip install motioneye --upgrade
-```
-
-____________________________________________________________________________________________
-
-
-
-
- File Browser
-
-
-
- File Browser
-
-To Install File Browser, ⚠️ run the following in the LXC console.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/filebrowser-v3.sh)"
-```
-
-[File Browser](https://filebrowser.org/features) is a create-your-own-cloud-kind of software where you can install it on a server, direct it to a path and then access your files through a nice web interface. Many available features!
-
-
-
-**File Browser Interface - http:// IP:8080**
-
-⚙️ **Initial Login**
-
-**username**
- ```yaml
- admin
- ```
- **password**
- ```yaml
- changeme
- ```
-
-⚙️ **To Update File Browser**
-
-```yaml
-curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
-```
-___________________________________________________________________________________________
-
-
-
-
- Webmin System Administration
-
-
-
- Webmin System Administration
-
-To Install Webmin System Administration [(Screenshot)](https://raw.githubusercontent.com/tteck/Proxmox/main/misc/images/file-manager.png), ⚠️ run the following in the LXC console.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/webmin.sh)"
-```
-
-If you prefer to manage all aspects of your Proxmox LXC from a graphical interface instead of the command line interface, Webmin might be right for you.
-
-Benefits include automatic daily security updates, backup and restore, file manager with editor, web control panel, and preconfigured system monitoring with optional email alerts.
-
-
-
-**Webmin Interface - https:// IP:10000 (https)**
-
-⚙️ **Initial Login**
-
-**username**
- ```yaml
- root
- ```
- **password**
- ```yaml
- root
- ```
-
-⚙️ **To Update Webmin**
-
-```yaml
-Update from the Webmin UI
-```
-⚙️ **To Uninstall Webmin**
-
-Run in the LXC console
-```yaml
-bash /etc/webmin/uninstall.sh
-```
-___________________________________________________________________________________________
-
-
-
-
- WireGuard LXC
-
-
-
- WireGuard LXC
- With WGDashboard
-
-To create a new Proxmox WireGuard LXC, run the following in the Proxmox Shell.
-
-```
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/wireguard-v3.sh)"
-```
-
-⚡ Default Settings: 512MiB RAM - 2GB Storage - 1vCPU ⚡
-
-**WGDashboard Interface - http:// IP:10086**
-
-⚙️ **Initial Login**
-
-**username**
- ```yaml
- admin
- ```
- **password**
- ```yaml
- admin
- ```
-
-⚙️ **Host Configuration**
-
-Run in the LXC console
- ```yaml
- nano /etc/pivpn/wireguard/setupVars.conf
- ```
- ⚙️**Add Clients**
-
- Run in the LXC console
- ```yaml
- pivpn add
- ```
-⚙️ **To Update WireGuard**
-
-Run in the LXC console
- ```yaml
-apt update && apt upgrade -y
-```
-____________________________________________________________________________________________
-
-
-
-
- CrowdSec
-
-
-
- CrowdSec
-
-To Install CrowdSec, ⚠️ run the following in the LXC console.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/crowdsec-v3.sh)"
-```
-
-[CrowdSec](https://crowdsec.net/) is a free, open-source and collaborative IPS. Analyze behaviors, respond to attacks & share signals across the community.
-
-[**Control center for your CrowdSec machines.**](https://app.crowdsec.net/product-tour)
-
-___________________________________________________________________________________________
-
-
-
-
- Keycloak LXC
-
-
-
- Keycloak LXC
-
-To create a new Proxmox Keycloak LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/keycloak-v3.sh)"
-```
-
-[Keycloak](https://www.keycloak.org/) is an Open Source Identity and Access Management solution for modern Applications and Services.
-
-**Keycloak Interface - http:// IP:8080** (First start can take a few minutes)
-
-⚙️ **Initial Login**
-
-The initial admin user can be added manually using the web frontend when accessed from localhost or automatically using environment variables.
-
-To add the initial admin user using environment variables, set `KEYCLOAK_ADMIN` for the initial admin username and `KEYCLOAK_ADMIN_PASSWORD` for the initial admin password.
-
-First, stop Keycloak
-```yaml
-systemctl stop keycloak.service
-```
-then start Keycloak by coping & pasting the following (only needed once)
-```yaml
-cd /opt/keycloak
-export KEYCLOAK_ADMIN=admin
-export KEYCLOAK_ADMIN_PASSWORD=changeme
-
-bin/kc.sh start-dev
-```
-⚙️ **To Update Keycloak**
-
-```yaml
-working On
-```
-___________________________________________________________________________________________
-
-
-
-
- Vaultwarden LXC
-
-
-
- Vaultwarden LXC
-
-Alternative implementation of the Bitwarden server API written in Rust and compatible with upstream [Bitwarden clients](https://bitwarden.com/download/), perfect for self-hosted deployment where running the official resource-heavy service might not be ideal.
-
-To create a new Proxmox Vaultwarden LXC, run the following in the Proxmox Shell.
-
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/vaultwarden-v3.sh)"
-```
-⚠️ Vaultwarden needs to be behind a proxy (Nginx Proxy Manager) to obtain HTTPS and to allow clients to connect.
-
-The script builds from source, which takes time and resources. After the build, the script will automatically set resources to Normal Settings.
-
-Expect 30+ minute install time.
-⚡ Normal Settings: 512Mib RAM - 6GB Storage - 1vCPU ⚡
-
-**Vaultwarden Interface - IP:8000**
-
-⚙️ **Path to Vaultwarden .env file** (to enable `ADMIN_TOKEN`)
-```yaml
-/opt/vaultwarden/.env
-```
-
-⚙️ **To Update Vaultwarden**
-
-Run in the LXC console
-```yaml
-bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/vaultwarden-update.sh)"
-```
-
-____________________________________________________________________________________________
-
-
+Proxmox Helper Scripts
+ Be cautious and thoroughly evaluate scripts and automation tasks obtained from external sources.
diff --git a/_config.yml b/_config.yml
deleted file mode 100644
index 6979f9d8..00000000
--- a/_config.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-theme: jekyll-theme-hacker
-title: Proxmox Helper Scripts
-description: Proxmox Scripts For Home Automation
-markdown: kramdown
-kramdown:
- parse_block_html: true
diff --git a/ct/adguard-v1.sh b/ct/adguard-v1.sh
deleted file mode 100644
index daada894..00000000
--- a/ct/adguard-v1.sh
+++ /dev/null
@@ -1,162 +0,0 @@
-#!/usr/bin/env bash
-
-while true; do
- read -p "This will create a New AdGuard Home LXC. Proceed(y/n)?" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes or no.";;
- esac
-done
-
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
-trap die ERR
-trap cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/adguard_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using '$STORAGE' for storage location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "LXC ID is $CTID."
-
-echo -e "${CHECKMARK} \e[1;92m Updating LXC Template List... \e[0m"
-pveam update >/dev/null
-
-echo -e "${CHECKMARK} \e[1;92m Downloading LXC Template... \e[0m"
-OSTYPE=debian
-OSVERSION=${OSTYPE}-11
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-
-echo -e "${CHECKMARK} \e[1;92m Creating LXC... \e[0m"
-DISK_SIZE=2G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
-ARCH=$(dpkg --print-architecture)
-HOSTNAME=adguard
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 1 -memory 512 \
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-
-echo -e "${CHECKMARK} \e[1;92m Starting LXC... \e[0m"
-pct start $CTID
-pct push $CTID adguard_setup.sh /adguard_setup.sh -perms 755
-pct exec $CTID /adguard_setup.sh
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully created a AdGuard Home LXC to $CTID"
-echo -e "\e[1;92m AdGuard Home Setup should be reachable by going to the following URL.
- http://${IP}:3000
-\e[0m"
diff --git a/ct/adguard-v2.sh b/ct/adguard-v2.sh
deleted file mode 100644
index 9838585b..00000000
--- a/ct/adguard-v2.sh
+++ /dev/null
@@ -1,256 +0,0 @@
-#!/usr/bin/env bash
-
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New Adguard Home 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 "${GN}
- _ _
- /\ | | | |
- / \ __| | __ _ _ _ __ _ _ __ __| |
- / /\ \ / _ |/ _ | | | |/ _ | __/ _ |
- / ____ \ (_| | (_| | |_| | (_| | | | (_| |
- /_/ \_\__,_|\__, |\__,_|\__,_|_| \__,_|
- __/ |
- |___/
-
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=2
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname adguard
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 512
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/adguard-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created Adguard Home LXC to${CL} ${BL}$CTID${CL}.
-${GN}Adguard${CL} Setup should be reachable by going to the following URL.
- ${BL}http://${IP}:3000${CL} \n"
-
diff --git a/ct/adguard-v3.sh b/ct/adguard-v3.sh
deleted file mode 100644
index b9bf7a50..00000000
--- a/ct/adguard-v3.sh
+++ /dev/null
@@ -1,354 +0,0 @@
-#!/usr/bin/env bash
-
-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="Adguard"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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 "${GN}
- _ _
- /\ | | | |
- / \ __| | __ _ _ _ __ _ _ __ __| |
- / /\ \ / _ |/ _ | | | |/ _ | __/ _ |
- / ____ \ (_| | (_| | |_| | (_| | | | (_| |
- /_/ \_\__,_|\__, |\__,_|\__,_|_| \__,_|
- 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}2${CL}${DGN}GB${CL}"
- DISK_SIZE="2"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}512${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="512"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 2 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/adguard-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 "Adguard Setup should be reachable by going to the following URL.
- ${BL}http://${IP}:3000${CL} \n"
diff --git a/ct/adguard-v5.sh b/ct/adguard-v5.sh
new file mode 100644
index 00000000..73a5eb9c
--- /dev/null
+++ b/ct/adguard-v5.sh
@@ -0,0 +1,444 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ___ __ __
+ / | ____/ /___ ___v5______ __________/ /
+ / /| |/ __ / __ / / / / __ / ___/ __ /
+ / ___ / /_/ / /_/ / /_/ / /_/ / / / /_/ /
+/_/ |_\__,_/\__, /\__,_/\__,_/_/ \__,_/
+ /____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Adguard"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Stopping AdguardHome"
+systemctl stop AdGuardHome
+msg_ok "Stopped AdguardHome"
+
+msg_info "Updating AdguardHome"
+wget -qL https://static.adguard.com/adguardhome/release/AdGuardHome_linux_amd64.tar.gz
+tar -xvf AdGuardHome_linux_amd64.tar.gz &>/dev/null
+mkdir -p adguard-backup
+cp -r /opt/AdGuardHome/AdGuardHome.yaml /opt/AdGuardHome/data adguard-backup/
+cp AdGuardHome/AdGuardHome /opt/AdGuardHome/AdGuardHome
+cp -r adguard-backup/* /opt/AdGuardHome/
+msg_ok "Updated AdguardHome"
+
+msg_info "Starting AdguardHome"
+systemctl start AdGuardHome
+msg_ok "Started AdguardHome"
+
+msg_info "Cleaning Up"
+rm -rf AdGuardHome_linux_amd64.tar.gz AdGuardHome adguard-backup
+msg_ok "Cleaned"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/AdGuardHome ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} Setup should be reachable by going to the following URL.
+ ${BL}http://${IP}:3000${CL} \n"
diff --git a/ct/alpine-v5.sh b/ct/alpine-v5.sh
new file mode 100644
index 00000000..6357beb8
--- /dev/null
+++ b/ct/alpine-v5.sh
@@ -0,0 +1,419 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ___ v5 __ _
+ / | / /___ (_)___ ___
+ / /| | / / __ \/ / __ \/ _ \
+ / ___ |/ / /_/ / / / / / __/
+/_/ |_/_/ .___/_/_/ /_/\___/
+ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Alpine"
+var_disk="0.1"
+var_cpu="1"
+var_ram="512"
+var_os="alpine"
+var_version="3.17"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}alpine${CL}"
+ PW="-password alpine"
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apk update &>/dev/null
+apk upgrade &>/dev/null
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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"
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} ${var_version} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/alpine-vaultwarden-v5.sh b/ct/alpine-vaultwarden-v5.sh
new file mode 100644
index 00000000..644f43da
--- /dev/null
+++ b/ct/alpine-vaultwarden-v5.sh
@@ -0,0 +1,455 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+ _ __ ____ __
+| | / /___ ___ __/ / /__ ______ __________/ /__v5____
+| | / / __ `/ / / / / __/ | /| / / __ `/ ___/ __ / _ \/ __ \
+| |/ / /_/ / /_/ / / /_ | |/ |/ / /_/ / / / /_/ / __/ / / /
+|___/\__,_/\__,_/_/\__/ |__/|__/\__,_/_/ \__,_/\___/_/ /_/
+ Alpine 3.17
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Alpine-Vaultwarden"
+var_disk="0.3"
+var_cpu="1"
+var_ram="256"
+var_os="alpine"
+var_version="3.17"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}alpine${CL}"
+ PW="-password alpine"
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+ normal=$(echo "\033[m")
+ menu=$(echo "\033[36m")
+ number=$(echo "\033[33m")
+ fgred=$(echo "\033[31m")
+ printf "\n${menu}*********************************************${normal}\n"
+ printf "${menu}**${number} 1)${normal} Update Vaultwarden \n"
+ printf "${menu}**${number} 2)${normal} View Admin Token\n"
+ printf "\n${menu}*********************************************${normal}\n"
+ printf "Please choose an option from the menu, or ${fgred}x${normal} to exit."
+ read opt
+
+while [ "$opt" != "" ]; do
+ case $opt in
+ 1)
+ clear
+ echo -e "${fgred}Update Vaultwarden${normal}"
+ apk update &>/dev/null
+ apk upgrade --update-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing vaultwarden
+
+ break
+ ;;
+ 2)
+ clear
+ echo -e "${fgred}View the Admin Token${normal}"
+ cat /etc/conf.d/vaultwarden | grep "ADMIN_TOKEN" | awk '{print substr($2, 7) }'
+
+ break
+ ;;
+ x)
+ exit
+ ;;
+ \n)
+ exit
+ ;;
+ *)
+ clear
+ echo -e "Please choose an option from the menu"
+ update_script
+ ;;
+ esac
+done
+exit
+}
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/conf.d/vaultwarden ]]; then
+ msg_error "No ${APP} Installation Found!"
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ -f /etc/conf.d/vaultwarden ]]; then
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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 -- ash -c "$(wget -qO - https://raw.githubusercontent.com/tteck/Proxmox/main/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8000${CL} \n"
diff --git a/ct/archlinux-v5.sh b/ct/archlinux-v5.sh
new file mode 100644
index 00000000..26385a0a
--- /dev/null
+++ b/ct/archlinux-v5.sh
@@ -0,0 +1,419 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ___ __ __ _
+ / | __________/ /_ v5 / / (_)___ __ ___ __
+ / /| | / ___/ ___/ __ \ / / / / __ \/ / / / |/_/
+ / ___ |/ / / /__/ / / / / /___/ / / / / /_/ /> <
+/_/ |_/_/ \___/_/ /_/ /_____/_/_/ /_/\__,_/_/|_|
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Arch Linux"
+var_disk="1"
+var_cpu="1"
+var_ram="512"
+var_os="archlinux"
+var_version="base"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}archlinux${CL}"
+ PW="-password archlinux"
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+pacman-key --init
+pacman-key --populate archlinux
+pacman -Sy archlinux-keyring && pacman -Su
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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"
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} ${var_version} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/audiobookshelf-v5.sh b/ct/audiobookshelf-v5.sh
new file mode 100644
index 00000000..ca4e5c9b
--- /dev/null
+++ b/ct/audiobookshelf-v5.sh
@@ -0,0 +1,421 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ___ __ __ __ ______
+ ____ ___ ______/ (_)___v5/ /_ ____ ____ / /_______/ /_ ___ / / __/
+ / __ `/ / / / __ / / __ \/ __ \/ __ \/ __ \/ //_/ ___/ __ \/ _ \/ / /_
+/ /_/ / /_/ / /_/ / / /_/ / /_/ / /_/ / /_/ / ,< (__ ) / / / __/ / __/
+\__,_/\__,_/\__,_/_/\____/_.___/\____/\____/_/|_/____/_/ /_/\___/_/_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="audiobookshelf"
+var_disk="4"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
+ CT_TYPE="0"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" OFF \
+ "0" "Privileged" ON \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:13378${CL} \n"
diff --git a/ct/autobrr-v5.sh b/ct/autobrr-v5.sh
new file mode 100644
index 00000000..b0ad08cc
--- /dev/null
+++ b/ct/autobrr-v5.sh
@@ -0,0 +1,437 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ___ __ __
+ / | __ __/ /_____ / /_v5__________
+ / /| |/ / / / __/ __ \/ __ \/ ___/ ___/
+ / ___ / /_/ / /_/ /_/ / /_/ / / / /
+/_/ |_\__,_/\__/\____/_.___/_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Autobrr"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Stopping ${APP} LXC"
+systemctl stop autobrr.service
+msg_ok "Stopped ${APP} LXC"
+
+msg_info "Updating ${APP} LXC"
+rm -rf /usr/local/bin/*
+wget -q $(curl -s https://api.github.com/repos/autobrr/autobrr/releases/latest | grep download | grep linux_x86_64 | cut -d\" -f4)
+tar -C /usr/local/bin -xzf autobrr*.tar.gz
+rm -rf autobrr*.tar.gz
+msg_ok "Updated ${APP} LXC"
+
+msg_info "Starting ${APP} LXC"
+systemctl start autobrr.service
+msg_ok "Started ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /root/.config/autobrr/config.toml ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:7474${CL} \n"
diff --git a/ct/blocky-v5.sh b/ct/blocky-v5.sh
new file mode 100644
index 00000000..64b905d2
--- /dev/null
+++ b/ct/blocky-v5.sh
@@ -0,0 +1,425 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __ __
+ / __ )/ /___v5_____/ /____ __
+ / __ / / __ \/ ___/ //_/ / / /
+ / /_/ / / /_/ / /__/ ,< / /_/ /
+/_____/_/\____/\___/_/|_|\__, /
+ /____/
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Blocky"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/blocky ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/casaos-v5.sh b/ct/casaos-v5.sh
new file mode 100644
index 00000000..074c4065
--- /dev/null
+++ b/ct/casaos-v5.sh
@@ -0,0 +1,437 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ______ ____ _____
+ / ____/___ __v5______ _/ __ \/ ___/
+ / / / __ `/ ___/ __ `/ / / /\__ \
+/ /___/ /_/ (__ ) /_/ / /_/ /___/ /
+\____/\__,_/____/\__,_/\____//____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="CasaOS"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}No${CL}"
+ FUSE="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "FUSE OVERLAYFS" --yesno "(ZFS) Enable Fuse Overlayfs?" 10 58); then
+ FUSE="yes"
+else
+ FUSE="no"
+fi
+ echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}$FUSE${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /etc/docker ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+if [ "$FUSE" == "yes" ]; then
+FEATURES="fuse=1,keyctl=1,nesting=1"
+else
+FEATURES="keyctl=1,nesting=1"
+fi
+TEMP_DIR=$(mktemp -d)
+pushd $TEMP_DIR >/dev/null
+export tz=$timezone
+export ST=$FUSE
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -onboot 1
+ -cores $CORE_COUNT
+ -memory $RAM_SIZE
+ -unprivileged $CT_TYPE
+ $PW
+"
+bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
+LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: a
+lxc.cap.drop:
+EOF
+if [ "$CT_TYPE" == "0" ]; then
+cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: c 188:* rwm
+lxc.cgroup2.devices.allow: c 189:* rwm
+lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
+lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
+EOF
+fi
+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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} Setup should be reachable by going to the following URL.
+ ${BL}http://${IP} ${CL} \n"
diff --git a/ct/changedetection-v5.sh b/ct/changedetection-v5.sh
new file mode 100644
index 00000000..64899ce7
--- /dev/null
+++ b/ct/changedetection-v5.sh
@@ -0,0 +1,426 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ________ ____ __ __ _
+ / ____/ /_v5____ _____ ____ ____ / __ \___ / /____ _____/ /_(_)___ ____
+ / / / __ \/ __ `/ __ \/ __ `/ _ \ / / / / _ \/ __/ _ \/ ___/ __/ / __ \/ __ \
+/ /___/ / / / /_/ / / / / /_/ / __/ / /_/ / __/ /_/ __/ /__/ /_/ / /_/ / / / /
+\____/_/ /_/\__,_/_/ /_/\__, /\___/ /_____/\___/\__/\___/\___/\__/_/\____/_/ /_/
+ /____/
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Change Detection"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+pip3 install changedetection.io --upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/changedetection.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:5000${CL} \n"
diff --git a/ct/create_lxc.sh b/ct/create_lxc.sh
index 5bcce863..f8326f55 100644
--- a/ct/create_lxc.sh
+++ b/ct/create_lxc.sh
@@ -1,47 +1,69 @@
#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" == "yes" ]; then set -x; fi
+YW=$(echo "\033[33m")
+BL=$(echo "\033[36m")
+RD=$(echo "\033[01;31m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
BFR="\\r\\033[K"
HOLD="-"
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
}
-
function msg_info() {
- local msg="$1"
- echo -ne " ${HOLD} ${YW}${msg}..."
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
}
function msg_ok() {
- local msg="$1"
- echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Validating Storage"
+VALIDCT=$(pvesm status -content rootdir | awk 'NR>1')
+if [ -z "$VALIDCT" ]; then
+ msg_error "Unable to detect a valid Container Storage location."
+ exit 1
+fi
+VALIDTMP=$(pvesm status -content vztmpl | awk 'NR>1')
+if [ -z "$VALIDTMP" ]; then
+ msg_error "Unable to detect a valid Template Storage location."
+ exit 1
+fi
function select_storage() {
local CLASS=$1
local CONTENT
local CONTENT_LABEL
case $CLASS in
- container) CONTENT='rootdir'; CONTENT_LABEL='Container';;
- template) CONTENT='vztmpl'; CONTENT_LABEL='Container template';;
- *) false || die "Invalid storage class.";;
+ container)
+ CONTENT='rootdir'
+ CONTENT_LABEL='Container'
+ ;;
+ template)
+ CONTENT='vztmpl'
+ CONTENT_LABEL='Container template'
+ ;;
+ *) false || exit "Invalid storage class." ;;
esac
local -a MENU
@@ -54,35 +76,32 @@ function select_storage() {
if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
local MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
fi
- MENU+=( "$TAG" "$ITEM" "OFF" )
+ MENU+=("$TAG" "$ITEM" "OFF")
done < <(pvesm status -content $CONTENT | awk 'NR>1')
- if [ $((${#MENU[@]}/3)) -eq 0 ]; then
- echo -e "'$CONTENT_LABEL' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
- elif [ $((${#MENU[@]}/3)) -eq 1 ]; then
+ if [ $((${#MENU[@]} / 3)) -eq 1 ]; then
printf ${MENU[0]}
- else
+ else
local STORAGE
- while [ -z "${STORAGE:+x}" ]; do
+ while [ -z "${STORAGE:+x}" ]; do
STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the ${CONTENT_LABEL,,}?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${MENU[@]}" 3>&1 1>&2 2>&3) || die "Menu aborted."
+ "Which storage pool you would like to use for the ${CONTENT_LABEL,,}?\n\n" \
+ 16 $(($MSG_MAX_LENGTH + 23)) 6 \
+ "${MENU[@]}" 3>&1 1>&2 2>&3) || exit "Menu aborted."
done
printf $STORAGE
fi
}
-[[ "${CTID:-}" ]] || die "You need to set 'CTID' variable."
-[[ "${PCT_OSTYPE:-}" ]] || die "You need to set 'PCT_OSTYPE' variable."
+[[ "${CTID:-}" ]] || exit "You need to set 'CTID' variable."
+[[ "${PCT_OSTYPE:-}" ]] || exit "You need to set 'PCT_OSTYPE' variable."
-[ "$CTID" -ge "100" ] || die "ID cannot be less than 100."
+[ "$CTID" -ge "100" ] || exit "ID cannot be less than 100."
if pct status $CTID &>/dev/null; then
echo -e "ID '$CTID' is already in use."
unset CTID
- die "Cannot use ID that is already in use."
+ exit "Cannot use ID that is already in use."
fi
TEMPLATE_STORAGE=$(select_storage template) || exit
@@ -97,24 +116,23 @@ msg_ok "Updated LXC Template List"
TEMPLATE_SEARCH=${PCT_OSTYPE}-${PCT_OSVERSION:-}
mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($TEMPLATE_SEARCH.*\)/\1/p" | sort -t - -k 2 -V)
-[ ${#TEMPLATES[@]} -gt 0 ] || die "Unable to find a template when searching for '$TEMPLATE_SEARCH'."
+[ ${#TEMPLATES[@]} -gt 0 ] || exit "Unable to find a template when searching for '$TEMPLATE_SEARCH'."
TEMPLATE="${TEMPLATES[-1]}"
if ! pveam list $TEMPLATE_STORAGE | grep -q $TEMPLATE; then
msg_info "Downloading LXC Template"
pveam download $TEMPLATE_STORAGE $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
+ exit "A problem occured while downloading the LXC template."
msg_ok "Downloaded LXC Template"
fi
DEFAULT_PCT_OPTIONS=(
-arch $(dpkg --print-architecture))
-
-PCT_OPTIONS=( ${PCT_OPTIONS[@]:-${DEFAULT_PCT_OPTIONS[@]}} )
-[[ " ${PCT_OPTIONS[@]} " =~ " -rootfs " ]] || PCT_OPTIONS+=( -rootfs $CONTAINER_STORAGE:${PCT_DISK_SIZE:-8} )
+
+PCT_OPTIONS=(${PCT_OPTIONS[@]:-${DEFAULT_PCT_OPTIONS[@]}})
+[[ " ${PCT_OPTIONS[@]} " =~ " -rootfs " ]] || PCT_OPTIONS+=(-rootfs $CONTAINER_STORAGE:${PCT_DISK_SIZE:-8})
msg_info "Creating LXC Container"
pct create $CTID ${TEMPLATE_STORAGE}:vztmpl/${TEMPLATE} ${PCT_OPTIONS[@]} >/dev/null ||
- die "A problem occured while trying to create container."
+ exit "A problem occured while trying to create container."
msg_ok "LXC Container ${BL}$CTID${CL} ${GN}was successfully created."
-
diff --git a/ct/cronicle-v5.sh b/ct/cronicle-v5.sh
new file mode 100644
index 00000000..890b08cc
--- /dev/null
+++ b/ct/cronicle-v5.sh
@@ -0,0 +1,468 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ______ _ __
+ / ____/________v5____ (_)____/ /__
+ / / / ___/ __ \/ __ \/ / ___/ / _ \
+/ /___/ / / /_/ / / / / / /__/ / __/
+\____/_/ \____/_/ /_/_/\___/_/\___/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Cronicle"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+hostname="$(hostname)"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+SERVER="y"
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+UPD=$(whiptail --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 2 \
+ "1" "Update ${APP}" ON \
+ "2" "Install ${APP} Worker" OFF \
+ 3>&1 1>&2 2>&3)
+
+header_info
+if [ "$UPD" == "1" ]; then
+ if [[ ! -d /opt/cronicle ]]; then
+ msg_error "No ${APP} Installation Found!";
+ exit
+ fi
+msg_info "Updating ${APP}"
+/opt/cronicle/bin/control.sh upgrade &>/dev/null
+msg_ok "Updated ${APP}"
+exit
+fi
+if [ "$UPD" == "2" ]; then
+LATEST=$(curl -sL https://api.github.com/repos/jhuckaby/Cronicle/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
+IP=$(hostname -I | awk '{print $1}')
+msg_info "Installing Dependencies"
+
+apt-get install -y git &>/dev/null
+apt-get install -y make &>/dev/null
+apt-get install -y g++ &>/dev/null
+apt-get install -y gcc &>/dev/null
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up Node.js Repository"
+bash <(curl -fsSL https://deb.nodesource.com/setup_16.x) &>/dev/null
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+apt-get install -y nodejs &>/dev/null
+msg_ok "Installed Node.js"
+
+msg_info "Installing Cronicle Worker"
+mkdir -p /opt/cronicle
+cd /opt/cronicle
+tar zxvf <(curl -fsSL https://github.com/jhuckaby/Cronicle/archive/${LATEST}.tar.gz) --strip-components 1 &>/dev/null
+npm install &>/dev/null
+node bin/build.js dist &>/dev/null
+sed -i "s/localhost:3012/${IP}:3012/g" /opt/cronicle/conf/config.json
+/opt/cronicle/bin/control.sh start &>/dev/null
+cp /opt/cronicle/bin/cronicled.init /etc/init.d/cronicled &>/dev/null
+chmod 775 /etc/init.d/cronicled
+update-rc.d cronicled defaults &>/dev/null
+msg_ok "Installed Cronicle Worker on $hostname"
+echo -e "\n Add Masters secret key to /opt/cronicle/conf/config.json \n"
+exit
+fi
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export SERV=$SERVER
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} Primary should be reachable by going to the following URL.
+ ${BL}http://${IP}:3012${CL} admin|admin \n"
diff --git a/ct/daemonsync-v2.sh b/ct/daemonsync-v2.sh
deleted file mode 100644
index 5b47dfa6..00000000
--- a/ct/daemonsync-v2.sh
+++ /dev/null
@@ -1,253 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New Daemon Sync Server 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}
- _____ _____
- | __ \ / ____|
- | | | | __ _ ___ _ __ ___ ___ _ __ | (___ _ _ _ __ ___
- | | | |/ _ |/ _ \ _ _ \ / _ \| _ \ \___ \| | | | _ \ / __|
- | |__| | (_| | __/ | | | | | (_) | | | | ____) | |_| | | | | (__
- |_____/ \__,_|\___|_| |_| |_|\___/|_| |_| |_____/ \__, |_| |_|\___|
- __/ |
- |___/
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=8
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname daemonsync
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 512
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/daemonsync-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created Daemon Sync Server LXC to${CL} ${BL}$CTID${CL}.
- Daemon Sync should be reachable by going to the following URL.
- ${BL}http://${IP}:8084${CL} \n"
diff --git a/ct/daemonsync-v3.sh b/ct/daemonsync-v3.sh
deleted file mode 100644
index f1f6c66d..00000000
--- a/ct/daemonsync-v3.sh
+++ /dev/null
@@ -1,353 +0,0 @@
-#!/usr/bin/env bash
-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="Daemon Sync"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}8${CL}${DGN}GB${CL}"
- DISK_SIZE="8"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}512${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="512"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 8 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/daemonsync-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}:8084${CL} \n"
diff --git a/ct/daemonsync-v5.sh b/ct/daemonsync-v5.sh
new file mode 100644
index 00000000..bb50f147
--- /dev/null
+++ b/ct/daemonsync-v5.sh
@@ -0,0 +1,427 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ _____
+ / __ \____ ____ ____ ___ ____ ____ / ___/__v5______ _____
+ / / / / __ / _ \/ __ __ \/ __ \/ __ \ \__ \/ / / / __ \/ ___/
+ / /_/ / /_/ / __/ / / / / / /_/ / / / / ___/ / /_/ / / / / /__
+/_____/\__,_/\___/_/ /_/ /_/\____/_/ /_/ /____/\__, /_/ /_/\___/
+ /____/
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Daemon Sync"
+var_disk="8"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /etc/daemonsync ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8084${CL} \n"
diff --git a/ct/dashy-v2.sh b/ct/dashy-v2.sh
deleted file mode 100644
index 49e63390..00000000
--- a/ct/dashy-v2.sh
+++ /dev/null
@@ -1,254 +0,0 @@
-#!/usr/bin/env bash
-clear
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New Dashy 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}
- _____ _
- | __ \ | |
- | | | | __ _ ___| |__ _ _
- | | | |/ _ / __| _ \| | | |
- | |__| | (_| \__ \ | | | |_| |
- |_____/ \__,_|___/_| |_|\__, |
- __/ |
- |___/
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=3
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname dashy
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 2
- -memory 2048
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/dashy-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created Dashy LXC to${CL} ${BL}$CTID${CL}.
-${BL}Dashy${CL} should be reachable by going to the following URL.
- ${BL}http://${IP}:4000${CL} \n"
diff --git a/ct/dashy-v3.sh b/ct/dashy-v3.sh
deleted file mode 100644
index 004197a8..00000000
--- a/ct/dashy-v3.sh
+++ /dev/null
@@ -1,353 +0,0 @@
-#!/usr/bin/env bash
-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="Dashy"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}3${CL}${DGN}GB${CL}"
- DISK_SIZE="3"
- echo -e "${DGN}Using ${BGN}2${CL}${DGN}vCPU${CL}"
- CORE_COUNT="2"
- echo -e "${DGN}Using ${BGN}2048${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="2048"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 3 "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="3"; 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/dashy-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}:4000${CL} \n"
diff --git a/ct/dashy-v5.sh b/ct/dashy-v5.sh
new file mode 100644
index 00000000..0b63ea64
--- /dev/null
+++ b/ct/dashy-v5.sh
@@ -0,0 +1,452 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __
+ / __ \____ ______/ /_ __ __
+ / / / / __ / ___/ __ \/ / / /
+ / /_/ / /_/ (__ ) / / / /_/ /
+/_____/\__,_/____/_/ /_/\__, /
+ v5 /____/
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Dashy"
+var_disk="6"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Stopping ${APP}"
+systemctl stop dashy
+msg_ok "Stopped ${APP}"
+
+msg_info "Backing up conf.yml"
+cd ~
+cp -R /dashy/public/conf.yml conf.yml
+msg_ok "Backed up conf.yml"
+
+msg_info "Updating Dashy"
+cd /dashy
+git merge &>/dev/null
+git pull origin master &>/dev/null
+yarn &>/dev/null
+yarn build &>/dev/null
+msg_ok "Updated Dashy"
+
+msg_info "Restoring conf.yml"
+cd ~
+cp -R conf.yml /dashy/public
+msg_ok "Restored conf.yml"
+
+msg_info "Cleaning"
+rm -rf conf.yml
+msg_ok "Cleaned"
+
+msg_info "Starting Dashy"
+systemctl start dashy
+msg_ok "Started Dashy"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/dashy.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:4000${CL} \n"
diff --git a/ct/debian-v1.sh b/ct/debian-v1.sh
deleted file mode 100644
index c002b0c6..00000000
--- a/ct/debian-v1.sh
+++ /dev/null
@@ -1,165 +0,0 @@
-#!/usr/bin/env bash
-
-while true; do
- read -p "This will create a New Debian 11 LXC Container. Proceed(y/n)?" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes or no.";;
- esac
-done
-
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
-trap die ERR
-trap cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/debian11_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using '$STORAGE' for storage location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "Container ID is $CTID."
-
-echo -e "${CHECKMARK} \e[1;92m Updating LXC Template List... \e[0m"
-pveam update >/dev/null
-
-echo -e "${CHECKMARK} \e[1;92m Downloading LXC Template... \e[0m"
-OSTYPE=debian
-OSVERSION=${OSTYPE}-11
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-
-echo -e "${CHECKMARK} \e[1;92m Creating LXC Container... \e[0m"
-DISK_SIZE=2G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
-ARCH=$(dpkg --print-architecture)
-HOSTNAME=debian11
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 1 -memory 512\
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-
-echo -e "${CHECKMARK} \e[1;92m Starting LXC Container... \e[0m"
-pct start $CTID
-pct push $CTID debian11_setup.sh /debian11_setup.sh -perms 755
-pct exec $CTID /debian11_setup.sh
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully created a Debian 11 LXC Container to $CTID at IP Address ${IP}"
diff --git a/ct/debian-v2.sh b/ct/debian-v2.sh
deleted file mode 100644
index 36ed693b..00000000
--- a/ct/debian-v2.sh
+++ /dev/null
@@ -1,257 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[32m"`
-CL=`echo "\033[m"`
-APP="Debian"
-HN=$(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}
- _____ _ _
- | __ \ | | (_)
- | | | | ___| |__ _ __ _ _ __
- | | | |/ _ \ _ \| |/ _ | _ \
- | |__| | __/ |_) | | (_| | | | |
- |_____/ \___|_.__/|_|\__,_|_| |_|
-
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=2
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 512
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some applications may not work properly due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$HN-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created ${APP} LXC to${CL} ${BL}$CTID${CL}. \n"
diff --git a/ct/debian-v3.sh b/ct/debian-v3.sh
deleted file mode 100644
index 764d3307..00000000
--- a/ct/debian-v3.sh
+++ /dev/null
@@ -1,352 +0,0 @@
-#!/usr/bin/env bash
-APP="Debian"
-var_disk="2"
-var_cpu="1"
-var_ram="512"
-var_os="debian"
-var_version="11"
-NEXTID=$(pvesh get /cluster/nextid)
-INTEGER='^[0-9]+$'
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-var_install="${NSAPP}-install"
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-BGN=`echo "\033[4;92m"`
-GN=`echo "\033[1;92m"`
-DGN=`echo "\033[32m"`
-CL=`echo "\033[m"`
-BFR="\\r\\033[K"
-HOLD="-"
-CM="${GN}✓${CL}"
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-function msg_info() {
- local msg="$1"
- echo -ne " ${HOLD} ${YW}${msg}..."
-}
-
-function msg_ok() {
- local msg="$1"
- echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
-}
-
-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}
- _____ _ _
- | __ \ | | (_)
- | | | | ___| |__ _ __ _ _ __
- | | | |/ _ \ _ \| |/ _ | _ \
- | |__| | __/ |_) | | (_| | | | |
- |_${YW}v3${RD}__/ \___|_.__/|_|\__,_|_| |_|
-${CL}"
-}
-
-header_info
-
-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}$var_disk${CL}${DGN}GB${CL}"
- DISK_SIZE="$var_disk"
- echo -e "${DGN}Using ${BGN}$var_cpu${CL}${DGN}vCPU${CL}"
- CORE_COUNT="$var_cpu"
- echo -e "${DGN}Using ${BGN}$var_ram${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="$var_ram"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: $var_disk "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; 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}${DGN}GB${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}${DGN}GB${CL}"
- echo -e "${YW}Allocate CPU cores, or Press [ENTER] for Default: $var_cpu "
- read CORE_COUNT
- if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; fi;
- echo -en "${DGN}Set Cores To ${BL}$CORE_COUNT${CL}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: $var_ram "
- read RAM_SIZE
- if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; fi;
- echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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
-
-export CTID=$CT_ID
-export PCT_OSTYPE=$var_os
-export PCT_OSVERSION=$var_version
-export PCT_DISK_SIZE=$DISK_SIZE
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=$BRG,ip=$NET$GATE$VLAN
- -onboot 1
- -cores $CORE_COUNT
- -memory $RAM_SIZE
- -unprivileged $CT_TYPE
- $PW
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-msg_info "Starting LXC Container"
-pct start $CTID
-msg_ok "Started LXC Container"
-
-lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-msg_ok "Completed Successfully!\n"
diff --git a/ct/debian-v5.sh b/ct/debian-v5.sh
new file mode 100644
index 00000000..b0c885f4
--- /dev/null
+++ b/ct/debian-v5.sh
@@ -0,0 +1,419 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __ _
+ / __ \___v5/ /_ (_)___ _____
+ / / / / _ \/ __ \/ / __ `/ __ \
+ / /_/ / __/ /_/ / / /_/ / / / /
+/_____/\___/_.___/_/\__,_/_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Debian"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} ${var_version} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/deconz-v3.sh b/ct/deconz-v3.sh
deleted file mode 100644
index 8667d0ac..00000000
--- a/ct/deconz-v3.sh
+++ /dev/null
@@ -1,366 +0,0 @@
-#!/usr/bin/env bash
-APP="deCONZ"
-var_disk="4"
-var_cpu="2"
-var_ram="1024"
-var_os="ubuntu"
-var_version="20.04"
-NEXTID=$(pvesh get /cluster/nextid)
-INTEGER='^[0-9]+$'
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-var_install="${NSAPP}-install"
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-BGN=`echo "\033[4;92m"`
-GN=`echo "\033[1;92m"`
-DGN=`echo "\033[32m"`
-CL=`echo "\033[m"`
-BFR="\\r\\033[K"
-HOLD="-"
-CM="${GN}✓${CL}"
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-function msg_info() {
- local msg="$1"
- echo -ne " ${HOLD} ${YW}${msg}..."
-}
-
-function msg_ok() {
- local msg="$1"
- echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
-}
-
-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 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}Privileged${CL}"
- CT_TYPE="0"
- 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}$var_disk${CL}${DGN}GB${CL}"
- DISK_SIZE="$var_disk"
- echo -e "${DGN}Using ${BGN}$var_cpu${CL}${DGN}vCPU${CL}"
- CORE_COUNT="$var_cpu"
- echo -e "${DGN}Using ${BGN}$var_ram${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="$var_ram"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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 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}"
- else
- CT_TYPE1="Unprivileged"
- CT_TYPE="1"
- echo -en "${DGN}Set CT Type ${BL}Unprivileged${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: $var_disk "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; 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}${DGN}GB${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}${DGN}GB${CL}"
- echo -e "${YW}Allocate CPU cores, or Press [ENTER] for Default: $var_cpu "
- read CORE_COUNT
- if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; fi;
- echo -en "${DGN}Set Cores To ${BL}$CORE_COUNT${CL}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: $var_ram "
- read RAM_SIZE
- if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; fi;
- echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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
-
-export CTID=$CT_ID
-export PCT_OSTYPE=$var_os
-export PCT_OSVERSION=$var_version
-export PCT_DISK_SIZE=$DISK_SIZE
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=$BRG,ip=$NET$GATE$VLAN
- -onboot 1
- -cores $CORE_COUNT
- -memory $RAM_SIZE
- -unprivileged $CT_TYPE
- $PW
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-lxc.cgroup2.devices.allow: c 188:* rwm
-lxc.cgroup2.devices.allow: c 189:* rwm
-lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
-lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
-lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
-lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
-EOF
-
-msg_info "Starting LXC Container"
-pct start $CTID
-msg_ok "Started LXC Container"
-
-lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-msg_ok "Completed Successfully!\n"
-echo -e "${APP} should be reachable by going to the following URL.
- ${BL}http://${IP}${CL} \n"
diff --git a/ct/deconz-v5.sh b/ct/deconz-v5.sh
new file mode 100644
index 00000000..cdeb7a75
--- /dev/null
+++ b/ct/deconz-v5.sh
@@ -0,0 +1,442 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ __________ _ _______
+ ____/ /v5 / ____/ __ \/ | / /__ /
+ / __ / _ \/ / / / / / |/ / / /
+/ /_/ / __/ /___/ /_/ / /| / / /__
+\__,_/\___/\____/\____/_/ |_/ /____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="deCONZ"
+var_disk="4"
+var_cpu="2"
+var_ram="1024"
+var_os="ubuntu"
+var_version="20.04"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
+ echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
+ CT_TYPE="0"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/deconz.list ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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
+if [ "$CT_TYPE" == "0" ]; then
+ LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+ cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: a
+lxc.cap.drop:
+lxc.cgroup2.devices.allow: c 188:* rwm
+lxc.cgroup2.devices.allow: c 189:* rwm
+lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
+lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
+EOF
+fi
+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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}${CL}\n"
diff --git a/ct/deluge-v5.sh b/ct/deluge-v5.sh
new file mode 100644
index 00000000..7d95aa64
--- /dev/null
+++ b/ct/deluge-v5.sh
@@ -0,0 +1,427 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __
+ / __ \___ / /_v5______ ____
+ / / / / _ \/ / / / / __ `/ _ \
+ / /_/ / __/ / /_/ / /_/ / __/
+/_____/\___/_/\__,_/\__, /\___/
+ /____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Deluge"
+var_disk="4"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+pip3 install deluge[all] --upgrade
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/deluged.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8112${CL} \n"
diff --git a/ct/devuan-v5.sh b/ct/devuan-v5.sh
new file mode 100644
index 00000000..ac845530
--- /dev/null
+++ b/ct/devuan-v5.sh
@@ -0,0 +1,419 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____
+ / __ \___ _ ____ ______v5____
+ / / / / _ \ | / / / / / __ `/ __ \
+ / /_/ / __/ |/ / /_/ / /_/ / / / /
+/_____/\___/|___/\__,_/\__,_/_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Devuan"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="devuan"
+var_version="4.0"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}$NSAPP${CL}"
+ PW="-password $NSAPP"
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} ${var_version} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/docker-v2.sh b/ct/docker-v2.sh
deleted file mode 100644
index 43ceb81b..00000000
--- a/ct/docker-v2.sh
+++ /dev/null
@@ -1,312 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New Docker 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}
- _____ _
- | __ \ | |
- | | | | ___ ___| | _____ _ __
- | | | |/ _ \ / __| |/ / _ \ __|
- | |__| | (_) | (__| < __/ |
- |_____/ \___/ \___|_|\_\___|_|
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${RD} If Using ZFS, You Have Storage Driver Options${CL}\n"
- printf " ${RD} Non ZFS, Select Standard overlay2 Storage Driver${CL}\n"
- printf " ${YW} 1)${GN} Use fuse-overlayfs Storage Driver${CL}\n"
- printf " ${YW} 2)${GN} Use Standard overlay2 Storage Driver${CL}\n"
-
- printf "Please choose a Storage Driver and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using fuse-overlayfs Storage Driver";
- STORAGE_DRIVER="fuse"
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using overlay2 Storage Driver";
- STORAGE_DRIVER=" "
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Storage Driver from the menu";
- show_menu3;
- ;;
- esac
- done
-show_menu4(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message4=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
- printf " ${YW}${message4}${CL}\n"
-}
-show_menu4
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu4;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ] && [ "$STORAGE_DRIVER" == " " ]; then
- FEATURES="nesting=1,keyctl=1"
- elif
- [ "$IM" == "1" ] && [ "$STORAGE_DRIVER" == "fuse" ]; then
- FEATURES="nesting=1,keyctl=1,fuse=1"
- elif
- [ "$IM" == "0" ] && [ "$STORAGE_DRIVER" == "fuse" ]; then
- FEATURES="nesting=1,fuse=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=4
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname docker
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 2
- -memory 2048
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- wget -qL -O fuse-overlayfs https://github.com/containers/fuse-overlayfs/releases/download/v1.8.2/fuse-overlayfs-x86_64
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
- if [ "$STORAGE_TYPE" == "zfspool" ] && [ "$STORAGE_DRIVER" == "fuse" ]; then
- pct push $CTID fuse-overlayfs /usr/local/bin/fuse-overlayfs -perms 755
- info "Using ${BL}fuse-overlayfs${CL} Storage Driver."
- else
- info "Using ${BL}overlay2${CL} Storage Driver."
- fi
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/docker-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created Docker LXC to${CL} ${BL}$CTID${CL}. \n"
diff --git a/ct/docker-v3.sh b/ct/docker-v3.sh
deleted file mode 100644
index c6f0f248..00000000
--- a/ct/docker-v3.sh
+++ /dev/null
@@ -1,356 +0,0 @@
-#!/usr/bin/env bash
-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="Docker"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}4${CL}${DGN}GB${CL}"
- DISK_SIZE="4"
- echo -e "${DGN}Using ${BGN}2${CL}${DGN}vCPU${CL}"
- CORE_COUNT="2"
- echo -e "${DGN}Using ${BGN}2048${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="2048"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 4 "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="4"; 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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;
-}
-
-PVE_CHECK
-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=$BRG,ip=$NET$GATE$VLAN
- -onboot 1
- -cores $CORE_COUNT
- -memory $RAM_SIZE
- -unprivileged $CT_TYPE
- $PW
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-
-msg_info "Starting LXC Container"
-pct start $CTID
-msg_ok "Started LXC Container"
-
-lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/docker-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"
diff --git a/ct/docker-v5.sh b/ct/docker-v5.sh
new file mode 100644
index 00000000..677398a0
--- /dev/null
+++ b/ct/docker-v5.sh
@@ -0,0 +1,446 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __
+ / __ \____ _____/ /_v5__ _____
+ / / / / __ \/ ___/ //_/ _ \/ ___/
+ / /_/ / /_/ / /__/ ,< / __/ /
+/_____/\____/\___/_/|_|\___/_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Docker"
+var_disk="4"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}No${CL}"
+ FUSE="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "FUSE OVERLAYFS" --yesno "(ZFS) Enable Fuse Overlayfs?" 10 58); then
+ FUSE="yes"
+else
+ FUSE="no"
+fi
+ echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}$FUSE${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+if [ "$FUSE" == "yes" ]; then
+FEATURES="fuse=1,keyctl=1,nesting=1"
+else
+FEATURES="keyctl=1,nesting=1"
+fi
+TEMP_DIR=$(mktemp -d)
+pushd $TEMP_DIR >/dev/null
+export tz=$timezone
+export ST=$FUSE
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -onboot 1
+ -cores $CORE_COUNT
+ -memory $RAM_SIZE
+ -unprivileged $CT_TYPE
+ $PW
+"
+bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
+LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: a
+lxc.cap.drop:
+EOF
+if [ "$CT_TYPE" == "0" ]; then
+LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: c 188:* rwm
+lxc.cgroup2.devices.allow: c 189:* rwm
+lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
+lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
+EOF
+fi
+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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/emby-v5.sh b/ct/emby-v5.sh
new file mode 100644
index 00000000..d138f812
--- /dev/null
+++ b/ct/emby-v5.sh
@@ -0,0 +1,460 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ______ __
+ / ____/___ v5_ / /_ __ __
+ / __/ / __ __ \/ __ \/ / / /
+ / /___/ / / / / / /_/ / /_/ /
+/_____/_/ /_/ /_/_.___/\__, /
+ /____/
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Emby"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="ubuntu"
+var_version="20.04"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
+ echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
+ CT_TYPE="0"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if var_version=$(whiptail --title "UBUNTU VERSION" --radiolist "Choose Version" 10 58 4 \
+ "18.04" "Bionic" OFF \
+ "20.04" "Focal" ON \
+ "22.04" "Jammy" OFF \
+ "22.10" "Kinetic" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"
+else
+ exit-script
+fi
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" OFF \
+ "0" "Privileged" ON \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+LATEST=$(curl -sL https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
+msg_info "Stopping ${APP}"
+systemctl stop emby-server
+msg_ok "Stopped ${APP}"
+
+msg_info "Updating ${APP}"
+wget https://github.com/MediaBrowser/Emby.Releases/releases/download/${LATEST}/emby-server-deb_${LATEST}_amd64.deb &>/dev/null
+dpkg -i emby-server-deb_${LATEST}_amd64.deb &>/dev/null
+rm emby-server-deb_${LATEST}_amd64.deb
+msg_ok "Updated ${APP}"
+
+msg_info "Starting ${APP}"
+systemctl start emby-server
+msg_ok "Started ${APP}"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/emby-server ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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
+if [ "$CT_TYPE" == "0" ]; then
+ LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: c 226:0 rwm
+lxc.cgroup2.devices.allow: c 226:128 rwm
+lxc.cgroup2.devices.allow: c 29:0 rwm
+lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file
+lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
+lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file
+EOF
+fi
+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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8096${CL}\n"
diff --git a/ct/emqx-v5.sh b/ct/emqx-v5.sh
new file mode 100644
index 00000000..45bbd9fa
--- /dev/null
+++ b/ct/emqx-v5.sh
@@ -0,0 +1,421 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ________ _______v5 _ __
+ / ____/ |/ / __ \ | |/ /
+ / __/ / /|_/ / / / / | /
+ / /___/ / / / /_/ / / |
+/_____/_/ /_/\___\_\/_/|_|
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="EMQX"
+var_disk="4"
+var_cpu="2"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} Setup should be reachable by going to the following URL.
+ ${BL}http://${IP}:18083${CL} \n"
diff --git a/ct/esphome-v1.sh b/ct/esphome-v1.sh
deleted file mode 100644
index 902c9969..00000000
--- a/ct/esphome-v1.sh
+++ /dev/null
@@ -1,188 +0,0 @@
-#!/usr/bin/env bash
-
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-
-while true; do
- read -p "This will create a New ESPHome LXC Container. 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 "${CL}
- ______ _____ _____ _ _ ____ __ __ ______
- | ____|/ ____| __ \| | | |/ __ \| \/ | ____|
- | |__ | (___ | |__) | |__| | | | | \ / | |__
- | __| \___ \| ___/| __ | | | | |\/| | __|
- | |____ ____) | | | | | | |__| | | | | |____
- |______|_____/|_| |_| |_|\____/|_| |_|______|
-
-${CL}"
-}
-
-header_info
-
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
-trap die ERR
-trap cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/esphome_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using ${BL}$STORAGE${CL} for storage location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "Container ID is ${BL}$CTID.${CL}"
-
-echo -en "${GN} Updating LXC Template List... "
-pveam update >/dev/null
-echo -e "${CM}${CL} \r"
-
-echo -en "${GN} Downloading LXC Template... "
-OSTYPE=debian
-OSVERSION=${OSTYPE}-11
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-echo -e "${CM}${CL} \r"
-
-echo -en "${GN} Creating LXC Container... "
-DISK_SIZE=4G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
-ARCH=$(dpkg --print-architecture)
-HOSTNAME=esphome
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 2 -memory 1024 \
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-echo -e "${CM}${CL} \r"
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-pct push $CTID esphome_setup.sh /esphome_setup.sh -perms 755
-echo -e "${CM}${CL} \r"
-pct exec $CTID /esphome_setup.sh
-
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully created ESPHome LXC Container to ${BL}$CTID${CL}"
-echo -e "${CL} ESPHome should be reachable by going to the following URL.
- ${BL}http://${IP}:6052${CL}
-\n"
diff --git a/ct/esphome-v2.sh b/ct/esphome-v2.sh
deleted file mode 100644
index 8fcbf29b..00000000
--- a/ct/esphome-v2.sh
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-APP="ESPHome"
-HN=$(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}
- ______ _____ _____ _ _ ____ __ __ ______
- | ____|/ ____| __ \| | | |/ __ \| \/ | ____|
- | |__ | (___ | |__) | |__| | | | | \ / | |__
- | __| \___ \| ___/| __ | | | | |\/| | __|
- | |____ ____) | | | | | | |__| | | | | |____
- |______|_____/|_| |_| |_|\____/|_| |_|______|
-
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=4
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 2
- -memory 1024
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$HN-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created ${APP} LXC to${CL} ${BL}$CTID${CL}.
-${BL}${APP}${CL} should be reachable by going to the following URL.
- ${BL}http://${IP}:6052${CL} \n"
diff --git a/ct/esphome-v3.sh b/ct/esphome-v3.sh
deleted file mode 100644
index b044cab7..00000000
--- a/ct/esphome-v3.sh
+++ /dev/null
@@ -1,352 +0,0 @@
-#!/usr/bin/env bash
-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="ESPHome"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}4${CL}${DGN}GB${CL}"
- DISK_SIZE="4"
- echo -e "${DGN}Using ${BGN}2${CL}${DGN}vCPU${CL}"
- CORE_COUNT="2"
- echo -e "${DGN}Using ${BGN}1024${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="1024"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 4 "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="4"; 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: 1024 "
- read RAM_SIZE
- if [ -z $RAM_SIZE ]; then RAM_SIZE="1024"; fi;
- echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/esphome-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}:6052${CL} \n"
diff --git a/ct/esphome-v5.sh b/ct/esphome-v5.sh
new file mode 100644
index 00000000..5cb1c4f2
--- /dev/null
+++ b/ct/esphome-v5.sh
@@ -0,0 +1,434 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ___________ ____ __ __
+ / ____/ ___// __ \/ / / /___v5____ ___ ___
+ / __/ \__ \/ /_/ / /_/ / __ \/ __ `__ \/ _ \
+ / /___ ___/ / ____/ __ / /_/ / / / / / / __/
+/_____//____/_/ /_/ /_/\____/_/ /_/ /_/\___/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="ESPHome"
+var_disk="4"
+var_cpu="2"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Stopping ESPHome"
+systemctl stop esphomeDashboard
+msg_ok "Stopped ESPHome"
+
+msg_info "Updating ESPHome"
+pip3 install esphome --upgrade &>/dev/null
+msg_ok "Updated ESPHome"
+
+msg_info "Starting ESPHome"
+systemctl start esphomeDashboard
+msg_ok "Started ESPHome"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /usr/local/bin/esphome ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:6052${CL} \n"
diff --git a/ct/go2rtc-v5.sh b/ct/go2rtc-v5.sh
new file mode 100644
index 00000000..cf95a685
--- /dev/null
+++ b/ct/go2rtc-v5.sh
@@ -0,0 +1,421 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+ ___ __
+ ____ _____ |__ \ _____/ /__v5__
+ / __ `/ __ \__/ // ___/ __/ ___/
+ / /_/ / /_/ / __// / / /_/ /__
+ \__, /\____/____/_/ \__/\___/
+/____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="go2rtc"
+var_disk="4"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:1984${CL} \n"
diff --git a/ct/grafana-v2.sh b/ct/grafana-v2.sh
deleted file mode 100644
index 04d65207..00000000
--- a/ct/grafana-v2.sh
+++ /dev/null
@@ -1,252 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New Grafana 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}
- _____ __
- / ____| / _|
- | | __ _ __ __ _| |_ __ _ _ __ __ _
- | | |_ | __/ _ | _/ _ | _ \ / _ |
- | |__| | | | (_| | || (_| | | | | (_| |
- \_____|_| \__,_|_| \__,_|_| |_|\__,_|
-
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=2
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname grafana
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 512
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd 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}')
-
-echo -e "${GN}Successfully created Grafana LXC to${CL} ${BL}$CTID${CL}.
-${BL}Grafana${CL} should be reachable by going to the following URL.
- ${BL}http://${IP}:3000${CL} \n"
diff --git a/ct/grafana-v3.sh b/ct/grafana-v3.sh
deleted file mode 100644
index 052d3f82..00000000
--- a/ct/grafana-v3.sh
+++ /dev/null
@@ -1,351 +0,0 @@
-#!/usr/bin/env bash
-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 ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}2${CL}${DGN}GB${CL}"
- DISK_SIZE="2"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}512${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="512"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 2 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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"
diff --git a/ct/grafana-v5.sh b/ct/grafana-v5.sh
new file mode 100644
index 00000000..2984483f
--- /dev/null
+++ b/ct/grafana-v5.sh
@@ -0,0 +1,427 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ______ ____
+ / ____/________ _/ __/___ _____v5____ _
+ / / __/ ___/ __ / /_/ __ / __ \/ __ /
+/ /_/ / / / /_/ / __/ /_/ / / / / /_/ /
+\____/_/ \__,_/_/ \__,_/_/ /_/\__,_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Grafana"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/grafana.list ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:3000${CL} \n"
diff --git a/ct/grocy-v5.sh b/ct/grocy-v5.sh
new file mode 100644
index 00000000..ca85cf3f
--- /dev/null
+++ b/ct/grocy-v5.sh
@@ -0,0 +1,426 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __________ _______ __
+ / __ / ___/ __ \/ ___/ / / /
+ / /_/ / / / /_/ / /__/ /_/ /
+ \__, /_/ v5\____/\___/\__, /
+/____/ /____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="grocy"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP}"
+bash /var/www/html/update.sh
+msg_ok "Updated ${APP}"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apache2/sites-available/grocy.conf ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}${CL} \n"
diff --git a/ct/heimdalldashboard-v2.sh b/ct/heimdalldashboard-v2.sh
deleted file mode 100644
index 1a60e74c..00000000
--- a/ct/heimdalldashboard-v2.sh
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/usr/bin/env bash
-PP=`echo "\e[1;35m"`
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-APP="Heimdall Dashboard"
-HN=$(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 "${PP}
- _ _ _ _ _ _ _____ _ _ _
- | | | | (_) | | | | | | __ \ | | | | | |
- | |__| | ___ _ _ __ ___ __| | __ _| | | | | | | __ _ ___| |__ | |__ ___ __ _ _ __ __| |
- | __ |/ _ \ | _ _ \ / _ |/ _ | | | | | | |/ _ / __| _ \| _ \ / _ \ / _ | __/ _ |
- | | | | __/ | | | | | | (_| | (_| | | | | |__| | (_| \__ \ | | | |_) | (_) | (_| | | | (_| |
- |_| |_|\___|_|_| |_| |_|\__,_|\__,_|_|_| |_____/ \__,_|___/_| |_|_.__/ \___/ \__,_|_| \__,_|
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and press [ENTER] or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and press [ENTER] or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and press [ENTER] or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=2
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 512
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press [ENTER]."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$HN-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created ${APP} LXC to${CL} ${BL}$CTID${CL}.
-${BL}${APP}${CL} should be reachable by going to the following URL.
- ${BL}http://${IP}:7990${CL} \n"
diff --git a/ct/heimdalldashboard-v3.sh b/ct/heimdalldashboard-v3.sh
deleted file mode 100644
index bcb2ec5b..00000000
--- a/ct/heimdalldashboard-v3.sh
+++ /dev/null
@@ -1,352 +0,0 @@
-#!/usr/bin/env bash
-NEXTID=$(pvesh get /cluster/nextid)
-INTEGER='^[0-9]+$'
-PP=`echo "\e[1;35m"`
-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="Heimdall Dashboard"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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 "${PP}
- _ _ _ _ _ _ _____ _ _ _
- | | | | (_) | | | | | | __ \ | | | | | |
- | |__| | ___ _ _ __ ___ __| | __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}2${CL}${DGN}GB${CL}"
- DISK_SIZE="2"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}512${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="512"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 2 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/heimdalldashboard-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}:7990${CL} \n"
diff --git a/ct/heimdalldashboard-v5.sh b/ct/heimdalldashboard-v5.sh
new file mode 100644
index 00000000..8853bb2b
--- /dev/null
+++ b/ct/heimdalldashboard-v5.sh
@@ -0,0 +1,506 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _ _ _ _ ___ _ _ _
+ /\ /\___(_)_ __ ___ __| | __ _| | | / \__ _ ___| |__ | |__ ___ __ _ _ __ __| |
+ / /_/ / _ \ | '_ ` _ \ / _` |/ _` | | | / /\ / _` / __| '_ \| '_ \ / _ \ / _` | '__/ _` |
+/ __ / __/ | | | | | | (_| | (_| | | |v5/ /_// (_| \__ \ | | | |_) | (_) | (_| | | | (_| |
+\/ /_/ \___|_|_| |_| |_|\__,_|\__,_|_|_| /___,' \__,_|___/_| |_|_.__/ \___/ \__,_|_| \__,_|
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Heimdall Dashboard"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Stopping ${APP}"
+systemctl disable heimdall.service &>/dev/null
+systemctl stop heimdall
+sleep 1
+msg_ok "Stopped ${APP}"
+
+msg_info "Backing up Data"
+if [ -d "/opt/Heimdall-2.4.6" ]; then
+ cp -R /opt/Heimdall-2.4.6/database database-backup
+ cp -R /opt/Heimdall-2.4.6/public public-backup
+elif [[ -d "/opt/Heimdall-2.4.7b" ]]; then
+ cp -R /opt/Heimdall-2.4.7b/database database-backup
+ cp -R /opt/Heimdall-2.4.7b/public public-backup
+elif [[ -d "/opt/Heimdall-2.4.8" ]]; then
+ cp -R /opt/Heimdall-2.4.8/database database-backup
+ cp -R /opt/Heimdall-2.4.8/public public-backup
+else
+ cp -R /opt/Heimdall/database database-backup
+ cp -R /opt/Heimdall/public public-backup
+fi
+sleep 1
+msg_ok "Backed up Data"
+
+RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]')
+msg_info "Updating Heimdall Dashboard to ${RELEASE}"
+curl --silent -o ${RELEASE}.tar.gz -L "https://github.com/linuxserver/Heimdall/archive/${RELEASE}.tar.gz" &>/dev/null
+tar xvzf ${RELEASE}.tar.gz &>/dev/null
+VER=$(curl -s https://api.github.com/repos/linuxserver/Heimdall/releases/latest |
+ grep "tag_name" |
+ awk '{print substr($2, 3, length($2)-4) }')
+
+if [ ! -d "/opt/Heimdall" ]; then
+ mv Heimdall-${VER} /opt/Heimdall
+else
+ cp -R Heimdall-${VER}/* /opt/Heimdall
+fi
+
+service_path="/etc/systemd/system/heimdall.service"
+echo "[Unit]
+Description=Heimdall
+After=network.target
+[Service]
+Restart=always
+RestartSec=5
+Type=simple
+User=root
+WorkingDirectory=/opt/Heimdall
+ExecStart="/usr/bin/php" artisan serve --port 7990 --host 0.0.0.0
+TimeoutStopSec=30
+[Install]
+WantedBy=multi-user.target" >$service_path
+msg_ok "Updated Heimdall Dashboard to ${RELEASE}"
+
+msg_info "Restoring Data"
+cp -R database-backup/* /opt/Heimdall/database
+cp -R public-backup/* /opt/Heimdall/public
+sleep 1
+msg_ok "Restored Data"
+
+msg_info "Cleanup"
+if [ -d "/opt/Heimdall-2.4.6" ]; then
+ rm -rf /opt/Heimdall-2.4.6
+ rm -rf /opt/v2.4.6.tar.gz
+elif [[ -d "/opt/Heimdall-2.4.7b" ]]; then
+ rm -rf /opt/Heimdall-2.4.7b
+ rm -rf /opt/v2.4.7b.tar.gz
+elif [[ -d "/opt/Heimdall-2.4.8" ]]; then
+ rm -rf /opt/Heimdall-2.4.8
+ rm -rf /opt/v2.4.8.tar.gz
+fi
+
+rm -rf ${RELEASE}.tar.gz
+rm -rf Heimdall-${VER}
+rm -rf public-backup
+rm -rf database-backup
+rm -rf Heimdall
+sleep 1
+msg_ok "Cleaned"
+
+msg_info "Starting ${APP}"
+systemctl enable --now heimdall.service &>/dev/null
+sleep 2
+msg_ok "Started ${APP}"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/Heimdall ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:7990${CL} \n"
diff --git a/ct/homeassistant-core-v5.sh b/ct/homeassistant-core-v5.sh
new file mode 100644
index 00000000..988b31df
--- /dev/null
+++ b/ct/homeassistant-core-v5.sh
@@ -0,0 +1,513 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _ _ _ _ ___
+ /\ /\___ _ __ ___ ___ /_\ ___ ___(_)___| |_ __ _ _ __ | |_ / __\___v5_ __ ___
+ / /_/ / _ \| '_ ` _ \ / _ \ //_\\/ __/ __| / __| __/ _` | '_ \| __| / / / _ \| '__/ _ \
+/ __ / (_) | | | | | | __/ / _ \__ \__ \ \__ \ || (_| | | | | |_ / /__| (_) | | | __/
+\/ /_/ \___/|_| |_| |_|\___| \_/ \_/___/___/_|___/\__\__,_|_| |_|\__| \____/\___/|_| \___|
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Home Assistant-Core"
+var_disk="8"
+var_cpu="2"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+STABLE=$(curl -s https://raw.githubusercontent.com/home-assistant/version/master/stable.json | grep "default" | awk '{print substr($2, 2, length($2)-3) }')
+BETA=$(curl -s https://raw.githubusercontent.com/home-assistant/version/master/beta.json | grep "default" | awk '{print substr($2, 2, length($2)-3) }')
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+ PY=$(ls /srv/homeassistant/lib/)
+ IP=$(hostname -I | awk '{print $1}')
+ UPD=$(whiptail --title "UPDATE" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 3 \
+ "1" "Update Core" ON \
+ "2" "Install HACS" OFF \
+ "3" "Install FileBrowser" OFF \
+ 3>&1 1>&2 2>&3)
+header_info
+if [ "$UPD" == "1" ]; then
+ if (whiptail --defaultno --title "SELECT BRANCH" --yesno "Use Beta Branch?" 10 58); then
+ clear
+ header_info
+ echo -e "${GN}Updating to Version ${BETA}${CL}"
+ BR="--pre "
+ else
+ clear
+ header_info
+ echo -e "${GN}Updating to Version ${STABLE}${CL}"
+ BR=""
+ fi
+ if [[ "$PY" == "python3.9" ]]; then echo -e "⚠️ Python 3.9 is deprecated and will be removed in Home Assistant 2023.2"; fi
+
+msg_info "Stopping Home Assistant"
+systemctl stop homeassistant
+msg_ok "Stopped Home Assistant"
+
+msg_info "Updating Home Assistant"
+source /srv/homeassistant/bin/activate
+pip install ${BR}--upgrade homeassistant &>/dev/null
+msg_ok "Updated Home Assistant"
+
+msg_info "Starting Home Assistant"
+systemctl start homeassistant
+sleep 2
+msg_ok "Started Home Assistant"
+msg_ok "Update Successful"
+echo -e "\n Go to http://${IP}:8123 \n"
+exit
+fi
+if [ "$UPD" == "2" ]; then
+msg_info "Installing Home Assistant Comunity Store (HACS)"
+apt update &>/dev/null
+apt install unzip &>/dev/null
+cd .homeassistant
+bash <(curl -fsSL https://get.hacs.xyz) &>/dev/null
+msg_ok "Installed Home Assistant Comunity Store (HACS)"
+echo -e "\n Reboot Home Assistant and clear browser cache then Add HACS integration.\n"
+exit
+fi
+if [ "$UPD" == "3" ]; then
+msg_info "Installing FileBrowser"
+curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash &>/dev/null
+filebrowser config init -a '0.0.0.0' &>/dev/null
+filebrowser config set -a '0.0.0.0' &>/dev/null
+filebrowser users add admin changeme --perm.admin &>/dev/null
+msg_ok "Installed FileBrowser"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/filebrowser.service"
+echo "[Unit]
+Description=Filebrowser
+After=network-online.target
+[Service]
+User=root
+WorkingDirectory=/root/
+ExecStart=/usr/local/bin/filebrowser -r /root/.homeassistant
+[Install]
+WantedBy=default.target" >$service_path
+
+systemctl enable --now filebrowser.service &>/dev/null
+msg_ok "Created Service"
+
+msg_ok "Completed Successfully!\n"
+echo -e "FileBrowser should be reachable by going to the following URL.
+ ${BL}http://$IP:8080${CL} admin|changeme\n"
+exit
+fi
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /srv/homeassistant ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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
+if [ "$CT_TYPE" == "0" ]; then
+ LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+ cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: a
+lxc.cap.drop:
+lxc.cgroup2.devices.allow: c 188:* rwm
+lxc.cgroup2.devices.allow: c 189:* rwm
+lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
+lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
+EOF
+fi
+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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8123${CL}"
diff --git a/ct/homeassistant-v1.sh b/ct/homeassistant-v1.sh
deleted file mode 100644
index 40c7652e..00000000
--- a/ct/homeassistant-v1.sh
+++ /dev/null
@@ -1,176 +0,0 @@
-#!/usr/bin/env bash
-
-while true; do
- read -p "This will create a New Home Assistant Container LXC. Proceed(y/n)?" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes or no.";;
- esac
-done
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
-trap die ERR
-trap cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/ha_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using '$STORAGE' for storage location."
-CTID=$(pvesh get /cluster/nextid)
-info "Container ID is $CTID."
-
-echo -e "${CHECKMARK} \e[1;92m Updating LXC Template List... \e[0m"
-pveam update >/dev/null
-echo -e "${CHECKMARK} \e[1;92m Downloading LXC Template... \e[0m"
-OSTYPE=debian
-OSVERSION=${OSTYPE}-11
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-
-echo -e "${CHECKMARK} \e[1;92m Creating LXC Container... \e[0m"
-DISK_SIZE=8G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- wget -qL -O fuse-overlayfs https://github.com/containers/fuse-overlayfs/releases/download/v1.8.2/fuse-overlayfs-x86_64
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
- ARCH=$(dpkg --print-architecture)
-HOSTNAME=homeassistant
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- CT_FEATURES="fuse=1,keyctl=1,mknod=1,nesting=1"
-else
- CT_FEATURES="nesting=1"
-fi
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features $CT_FEATURES \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 2 -memory 2048 \
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-
-echo -e "${CHECKMARK} \e[1;92m Starting LXC Container... \e[0m"
-pct start $CTID
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
-pct push $CTID fuse-overlayfs /usr/local/bin/fuse-overlayfs -perms 755
-info "Using fuse-overlayfs."
-fi
-pct push $CTID ha_setup.sh /ha_setup.sh -perms 755
-pct exec $CTID /ha_setup.sh
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully Created Home Assistant Container LXC to $CTID."
-msg "
-
-Home Assistant should be reachable by going to the following URL.
-
- http://${IP}:8123
-"
diff --git a/ct/homeassistant-v2.sh b/ct/homeassistant-v2.sh
deleted file mode 100644
index 938b6921..00000000
--- a/ct/homeassistant-v2.sh
+++ /dev/null
@@ -1,316 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[94m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New Home Assistant Container 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}
- _ _ _ _
- | | (_) | | | |
- | |__ ___ _ __ ___ ___ __ _ ___ ___ _ ___| |_ __ _ _ __ | |_
- | _ \ / _ \| _ _ \ / _ \/ _ / __/ __| / __| __/ _ | _ \| __|
- | | | | (_) | | | | | | __/ (_| \__ \__ \ \__ \ || (_| | | | | |_
- |_| |_|\___/|_| |_| |_|\___|\__,_|___/___/_|___/\__\__,_|_| |_|\__|
-
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${RD} If Using ZFS, You Have Storage Driver Options${CL}\n"
- printf " ${RD} Non ZFS, Select Standard overlay2 Storage Driver${CL}\n"
- printf " ${YW} 1)${GN} Use fuse-overlayfs Storage Driver${CL}\n"
- printf " ${YW} 2)${GN} Use Standard overlay2 Storage Driver${CL}\n"
-
- printf "Please choose a Storage Driver and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using fuse-overlayfs Storage Driver";
- STORAGE_DRIVER="fuse"
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using overlay2 Storage Driver";
- STORAGE_DRIVER=" "
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Storage Driver from the menu";
- show_menu3;
- ;;
- esac
- done
-show_menu4(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message4=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
- printf " ${YW}${message4}${CL}\n"
-}
-show_menu4
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu4;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ] && [ "$STORAGE_DRIVER" == " " ]; then
- FEATURES="nesting=1,keyctl=1"
- elif
- [ "$IM" == "1" ] && [ "$STORAGE_DRIVER" == "fuse" ]; then
- FEATURES="nesting=1,keyctl=1,fuse=1"
- elif
- [ "$IM" == "0" ] && [ "$STORAGE_DRIVER" == "fuse" ]; then
- FEATURES="nesting=1,fuse=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=16
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname homeassistant
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 2
- -memory 2048
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- wget -qL -O fuse-overlayfs https://github.com/containers/fuse-overlayfs/releases/download/v1.8.2/fuse-overlayfs-x86_64
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
- if [ "$STORAGE_TYPE" == "zfspool" ] && [ "$STORAGE_DRIVER" == "fuse" ]; then
- pct push $CTID fuse-overlayfs /usr/local/bin/fuse-overlayfs -perms 755
- info "Using ${BL}fuse-overlayfs${CL} Storage Driver."
- else
- info "Using ${BL}overlay2${CL} Storage Driver."
- fi
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/homeassistant-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created Home Assistant Container LXC to${CL} ${BL}$CTID${CL}.
-${BL}Home Assistant${CL} should be reachable by going to the following URL.
-
- ${BL}http://${IP}:8123${CL} \n"
diff --git a/ct/homeassistant-v3.sh b/ct/homeassistant-v3.sh
deleted file mode 100644
index 9da9f0c1..00000000
--- a/ct/homeassistant-v3.sh
+++ /dev/null
@@ -1,360 +0,0 @@
-#!/usr/bin/env bash
-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="Home Assistant"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}
- _ _ _ _
- | | ${YW}v3${CL}${BL} (_) | | | |
- | |__ ___ _ __ ___ ___ __ _ ___ ___ _ ___| |_ __ _ _ __ | |_
- | _ \ / _ \| _ _ \ / _ \/ _ / __/ __| / __| __/ _ | _ \| __|
- | | | | (_) | | | | | | __/ (_| \__ \__ \ \__ \ || (_| | | | | |_
- |_| |_|\___/|_| |_| |_|\___|\__,_|___/___/_|___/\__\__,_|_| |_|\__|
-${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}16${CL}${DGN}GB${CL}"
- DISK_SIZE="16"
- echo -e "${DGN}Using ${BGN}2${CL}${DGN}vCPU${CL}"
- CORE_COUNT="2"
- echo -e "${DGN}Using ${BGN}2048${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="2048"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 16 "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="16"; 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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;
-}
-
-PVE_CHECK
-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=$BRG,ip=$NET$GATE$VLAN
- -onboot 1
- -cores $CORE_COUNT
- -memory $RAM_SIZE
- -unprivileged $CT_TYPE
- $PW
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-
-msg_info "Starting LXC Container"
-pct start $CTID
-msg_ok "Started LXC Container"
-
-lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/homeassistant-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}:8123${CL}
-Portainer should be reachable by going to the following URL.
- ${BL}http://${IP}:9000${CL}\n"
diff --git a/ct/homeassistant-v5.sh b/ct/homeassistant-v5.sh
new file mode 100644
index 00000000..391f8080
--- /dev/null
+++ b/ct/homeassistant-v5.sh
@@ -0,0 +1,520 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ __ ___ _ __ __
+ / / / /___v5____ ___ ___ / | __________(_)____/ /_____ _____ / /_
+ / /_/ / __ \/ __ __ \/ _ \ / /| | / ___/ ___/ / ___/ __/ __ / __ \/ __/
+ / __ / /_/ / / / / / / __/ / ___ |(__ |__ ) (__ ) /_/ /_/ / / / / /_
+/_/ /_/\____/_/ /_/ /_/\___/ /_/ |_/____/____/_/____/\__/\__,_/_/ /_/\__/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Home Assistant"
+var_disk="16"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}No${CL}"
+ FUSE="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "FUSE OVERLAYFS" --yesno "(ZFS) Enable Fuse Overlayfs?" 10 58); then
+ FUSE="yes"
+else
+ FUSE="no"
+fi
+ echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}$FUSE${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+ UPD=$(whiptail --title "UPDATE" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 4 \
+ "1" "Update ALL Containers" ON \
+ "2" "Remove ALL Unused Images" OFF \
+ "3" "Install HACS" OFF \
+ "4" "Install FileBrowser" OFF \
+ 3>&1 1>&2 2>&3)
+header_info
+if [ "$UPD" == "1" ]; then
+msg_info "Updating All Containers"
+CONTAINER_LIST="${1:-$(docker ps -q)}"
+for container in ${CONTAINER_LIST}; do
+ CONTAINER_IMAGE="$(docker inspect --format "{{.Config.Image}}" --type container ${container})"
+ RUNNING_IMAGE="$(docker inspect --format "{{.Image}}" --type container "${container}")"
+ docker pull "${CONTAINER_IMAGE}"
+ LATEST_IMAGE="$(docker inspect --format "{{.Id}}" --type image "${CONTAINER_IMAGE}")"
+ if [[ "${RUNNING_IMAGE}" != "${LATEST_IMAGE}" ]]; then
+ echo "Updating ${container} image ${CONTAINER_IMAGE}"
+ DOCKER_COMMAND="$(runlike "${container}")"
+ docker rm --force "${container}"
+ eval ${DOCKER_COMMAND}
+ fi
+done
+msg_ok "Updated All Containers"
+exit
+fi
+if [ "$UPD" == "2" ]; then
+msg_info "Removing ALL Unused Images"
+docker image prune -af
+msg_ok "Removed ALL Unused Images"
+exit
+fi
+if [ "$UPD" == "3" ]; then
+msg_info "Installing Home Assistant Comunity Store (HACS)"
+apt update &>/dev/null
+apt install unzip &>/dev/null
+cd /var/lib/docker/volumes/hass_config/_data
+bash <(curl -fsSL https://get.hacs.xyz) &>/dev/null
+msg_ok "Installed Home Assistant Comunity Store (HACS)"
+echo -e "\n Reboot Home Assistant and clear browser cache then Add HACS integration.\n"
+exit
+fi
+if [ "$UPD" == "4" ]; then
+IP=$(hostname -I | awk '{print $1}')
+msg_info "Installing FileBrowser"
+curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash &>/dev/null
+filebrowser config init -a '0.0.0.0' &>/dev/null
+filebrowser config set -a '0.0.0.0' &>/dev/null
+filebrowser users add admin changeme --perm.admin &>/dev/null
+msg_ok "Installed FileBrowser"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/filebrowser.service"
+echo "[Unit]
+Description=Filebrowser
+After=network-online.target
+[Service]
+User=root
+WorkingDirectory=/root/
+ExecStart=/usr/local/bin/filebrowser -r /
+[Install]
+WantedBy=default.target" >$service_path
+
+systemctl enable --now filebrowser.service &>/dev/null
+msg_ok "Created Service"
+
+msg_ok "Completed Successfully!\n"
+echo -e "FileBrowser should be reachable by going to the following URL.
+ ${BL}http://$IP:8080${CL} admin|changeme\n"
+exit
+fi
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /var/lib/docker/volumes/hass_config/_data
+ ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+if [ "$FUSE" == "yes" ]; then
+FEATURES="fuse=1,keyctl=1,nesting=1"
+else
+FEATURES="keyctl=1,nesting=1"
+fi
+TEMP_DIR=$(mktemp -d)
+pushd $TEMP_DIR >/dev/null
+export tz=$timezone
+export ST=$FUSE
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -onboot 1
+ -cores $CORE_COUNT
+ -memory $RAM_SIZE
+ -unprivileged $CT_TYPE
+ $PW
+"
+bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
+LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: a
+lxc.cap.drop:
+EOF
+if [ "$CT_TYPE" == "0" ]; then
+LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: c 188:* rwm
+lxc.cgroup2.devices.allow: c 189:* rwm
+lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
+lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
+EOF
+fi
+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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8123${CL}
+Portainer should be reachable by going to the following URL.
+ ${BL}http://${IP}:9000${CL}\n"
diff --git a/ct/homebridge-v2.sh b/ct/homebridge-v2.sh
deleted file mode 100644
index 3e045697..00000000
--- a/ct/homebridge-v2.sh
+++ /dev/null
@@ -1,251 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New Homebridge 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}
- _ _ ____ __ __ ______ ____ _____ _____ _____ _____ ______
- | | | |/ __ \| \/ | ____| _ \| __ \|_ _| __ \ / ____| ____|
- | |__| | | | | \ / | |__ | |_) | |__) | | | | | | | | __| |__
- | __ | | | | |\/| | __| | _ <| _ / | | | | | | | |_ | __|
- | | | | |__| | | | | |____| |_) | | \ \ _| |_| |__| | |__| | |____
- |_| |_|\____/|_| |_|______|____/|_| \_\_____|_____/ \_____|______|
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=4
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname homebridge
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 1024
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/homebridge-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created Homebridge LXC to${CL} ${BL}$CTID${CL}.
-${BL}Homebridge${CL} should be reachable by going to the following URL.
- ${BL}http://${IP}:8581${CL} \n"
diff --git a/ct/homebridge-v3.sh b/ct/homebridge-v3.sh
deleted file mode 100644
index e8af57b3..00000000
--- a/ct/homebridge-v3.sh
+++ /dev/null
@@ -1,351 +0,0 @@
-#!/usr/bin/env bash
-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="Homebridge"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}4${CL}${DGN}GB${CL}"
- DISK_SIZE="4"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}1024${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="1024"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 4 "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="4"; 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: 1024 "
- read RAM_SIZE
- if [ -z $RAM_SIZE ]; then RAM_SIZE="1024"; fi;
- echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/homebridge-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 "Homebridge should be reachable by going to the following URL.
- ${BL}http://${IP}:8581${CL} \n"
diff --git a/ct/homebridge-v5.sh b/ct/homebridge-v5.sh
new file mode 100644
index 00000000..955813c7
--- /dev/null
+++ b/ct/homebridge-v5.sh
@@ -0,0 +1,427 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ ______ __ _____________ ____ ________ ____________
+ / / / / __ \/ |/ / ____/ __ )/ __ \/ _/ __ \/ ____/ ____/
+ / /_/ / / / / /|_/ / __/ / __ / /_/ // // / / / / __/ __/
+ / __ / /_/ / / / / /___/ /_/ / _, _// // /_/ / /_/ / /___
+/_/ /_/\____/_/v5/_/_____/_____/_/ |_/___/_____/\____/_____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Homebridge"
+var_disk="4"
+var_cpu="1"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/homebridge.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8581${CL} \n"
diff --git a/ct/homepage-v5.sh b/ct/homepage-v5.sh
new file mode 100644
index 00000000..cc799cb4
--- /dev/null
+++ b/ct/homepage-v5.sh
@@ -0,0 +1,433 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ __
+ / / / /___ ____ ___ ___ ____ ____ _____ ____
+ / /_/ / __ \/ __ `__ \/ _ \/ __ \/ __ `/ __ `/ _ \
+ / __ / /_/ / / / / / / __/ /_/ / /_/ / /_/ / __/
+/_/ /_/\____/_/ /_/ /_/\___/ .___/\__,_/\__, /\___/
+ /_/ v5 /____/
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Homepage"
+var_disk="3"
+var_cpu="2"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP}"
+if ! command -v pnpm >/dev/null 2>&1; then
+ npm install -g pnpm &>/dev/null
+fi
+cd /opt/homepage
+systemctl stop homepage
+git pull --force &>/dev/null
+pnpm install &>/dev/null
+pnpm build &>/dev/null
+systemctl start homepage
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/homepage.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} Setup should be reachable by going to the following URL.
+ ${BL}http://${IP}:3000${CL} \n"
diff --git a/ct/homer-v5.sh b/ct/homer-v5.sh
new file mode 100644
index 00000000..c99f3a70
--- /dev/null
+++ b/ct/homer-v5.sh
@@ -0,0 +1,450 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ __
+ / / / /___ ____ ___v5___ _____
+ / /_/ / __ \/ __ `__ \/ _ \/ ___/
+ / __ / /_/ / / / / / / __/ /
+/_/ /_/\____/_/ /_/ /_/\___/_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Homer"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Stopping ${APP}"
+systemctl stop homer
+msg_ok "Stopped ${APP}"
+
+msg_info "Backing up config.yml"
+cd ~
+cp -R /opt/homer/assets/config.yml config.yml
+msg_ok "Backed up config.yml"
+
+msg_info "Updating ${APP}"
+rm -rf /opt/homer/*
+cd /opt/homer
+wget -q https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip
+unzip homer.zip &>/dev/null
+msg_ok "Updated ${APP}"
+msg_info "Restoring conf.yml"
+cd ~
+cp -R config.yml /opt/homer/assets
+msg_ok "Restored conf.yml"
+
+msg_info "Cleaning"
+rm -rf config.yml /opt/homer/homer.zip
+msg_ok "Cleaned"
+
+msg_info "Starting ${APP}"
+systemctl start homer
+msg_ok "Started ${APP}"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/homer ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8010${CL} \n"
diff --git a/ct/hyperion-v5.sh b/ct/hyperion-v5.sh
new file mode 100644
index 00000000..13e1168c
--- /dev/null
+++ b/ct/hyperion-v5.sh
@@ -0,0 +1,441 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+ __ __ _
+ / / / /_ ______v5___ _____(_)___ ____
+ / /_/ / / / / __ \/ _ \/ ___/ / __ \/ __ \
+ / __ / /_/ / /_/ / __/ / / / /_/ / / / /
+/_/ /_/\__, / .___/\___/_/ /_/\____/_/ /_/
+ /____/_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Hyperion"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
+ CT_TYPE="0"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get install -y hyperion &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/hyperion.list ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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
+if [ "$CT_TYPE" == "0" ]; then
+ LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+ cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: a
+lxc.cap.drop:
+lxc.cgroup2.devices.allow: c 188:* rwm
+lxc.cgroup2.devices.allow: c 189:* rwm
+lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
+lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
+EOF
+fi
+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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8090${CL} \n"
diff --git a/ct/influxdb-v2.sh b/ct/influxdb-v2.sh
deleted file mode 100644
index 0d9e113c..00000000
--- a/ct/influxdb-v2.sh
+++ /dev/null
@@ -1,250 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New InfluxDB 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}
- _____ __ _ _____ ____
- |_ _| / _| | | __ \| _ \
- | | _ __ | |_| |_ ___ _| | | | |_) |
- | | | _ \| _| | | | \ \/ / | | | _ <
- _| |_| | | | | | | |_| |> <| |__| | |_) |
- |_____|_| |_|_| |_|\__,_/_/\_\_____/|____/
- with Telegraf
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=8
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname influxdb
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 2
- -memory 2048
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd 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}')
-
-echo -e "${GN}Successfully created InfluxDB LXC to${CL} ${BL}$CTID${CL}. \n"
diff --git a/ct/influxdb-v3.sh b/ct/influxdb-v3.sh
deleted file mode 100644
index cecd1364..00000000
--- a/ct/influxdb-v3.sh
+++ /dev/null
@@ -1,350 +0,0 @@
-#!/usr/bin/env bash
-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 ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}8${CL}${DGN}GB${CL}"
- DISK_SIZE="8"
- echo -e "${DGN}Using ${BGN}2${CL}${DGN}vCPU${CL}"
- CORE_COUNT="2"
- echo -e "${DGN}Using ${BGN}2048${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="2048"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 8 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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"
diff --git a/ct/influxdb-v5.sh b/ct/influxdb-v5.sh
new file mode 100644
index 00000000..3f1e42ed
--- /dev/null
+++ b/ct/influxdb-v5.sh
@@ -0,0 +1,425 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ ______ ____ ____
+ / _/_v5 / __/ /_ ___ __/ __ \/ __ )
+ / // __ \/ /_/ / / / / |/_/ / / / __ |
+ _/ // / / / __/ / /_/ /> /_/ / /_/ /
+/___/_/ /_/_/ /_/\__,_/_/|_/_____/_____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="InfluxDB"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/influxdb.list ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/iobroker-v3.sh b/ct/iobroker-v3.sh
deleted file mode 100644
index 48139515..00000000
--- a/ct/iobroker-v3.sh
+++ /dev/null
@@ -1,351 +0,0 @@
-#!/usr/bin/env bash
-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="ioBroker"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}8${CL}${DGN}GB${CL}"
- DISK_SIZE="8"
- echo -e "${DGN}Using ${BGN}2${CL}${DGN}vCPU${CL}"
- CORE_COUNT="2"
- echo -e "${DGN}Using ${BGN}2048${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="2048"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 8 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/iobroker-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}:8081${CL} \n"
diff --git a/ct/iobroker-v5.sh b/ct/iobroker-v5.sh
new file mode 100644
index 00000000..7e74a9f4
--- /dev/null
+++ b/ct/iobroker-v5.sh
@@ -0,0 +1,427 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _ ____ __
+ (_)___ / __ )_________ / /_____ _____
+ / / __ \/ __ / ___/ __ \/ //_/ _ \/ ___/
+ / / /_/ / /_/ / / / /_/ / ,< / __/ /
+/_/\____/_____/_/ v5\____/_/|_|\___/_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="ioBroker"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/iobroker ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8081${CL} \n"
diff --git a/ct/jackett-v5.sh b/ct/jackett-v5.sh
new file mode 100644
index 00000000..72a6a925
--- /dev/null
+++ b/ct/jackett-v5.sh
@@ -0,0 +1,425 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+ __ __ __ __
+ / /___ ______/ /_____v5/ /_/ /_
+ __ / / __ `/ ___/ //_/ _ \/ __/ __/
+/ /_/ / /_/ / /__/ ,< / __/ /_/ /_
+\____/\__,_/\___/_/|_|\___/\__/\__/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Jackett"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/jackett.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:9117${CL}\n"
diff --git a/ct/jellyfin-v1.sh b/ct/jellyfin-v1.sh
deleted file mode 100644
index 3b8e674a..00000000
--- a/ct/jellyfin-v1.sh
+++ /dev/null
@@ -1,171 +0,0 @@
-#!/usr/bin/env bash
-
-while true; do
- read -p "This will create a Jellyfin Media Server LXC Container. Proceed(y/n)?" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes or no.";;
- esac
-done
-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
-CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
-trap cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/jellyfin_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using '$STORAGE' for Storage Location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "Container ID is $CTID."
-
-echo -e "${CHECKMARK} \e[1;92m Updating LXC Template List... \e[0m"
-pveam update >/dev/null
-echo -e "${CHECKMARK} \e[1;92m Downloading LXC Template... \e[0m"
-OSTYPE=ubuntu
-OSVERSION=${OSTYPE}-20.04
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-
-echo -e "${CHECKMARK} \e[1;92m Creating LXC Container... \e[0m"
-DISK_SIZE=8G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
-ARCH=$(dpkg --print-architecture)
-HOSTNAME=jellyfin
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 2 -memory 2048\
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-lxc.cgroup2.devices.allow: c 226:0 rwm
-lxc.cgroup2.devices.allow: c 226:128 rwm
-lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
-lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file
-lxc.mount.entry: /dev/dri/renderD128 dev/renderD128 none bind,optional,create=file
-EOF
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-
-echo -e "${CHECKMARK} \e[1;92m Starting LXC Container... \e[0m"
-pct start $CTID
-pct push $CTID jellyfin_setup.sh /jellyfin_setup.sh -perms 755
-pct exec $CTID /jellyfin_setup.sh
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully Created Jellyfin Media Server LXC to $CTID."
-echo -e "\e[1;92m Jellyfin Media Server should be reachable by going to the following URL.
- http://${IP}:8096
-\e[0m"
diff --git a/ct/jellyfin-v3.sh b/ct/jellyfin-v3.sh
deleted file mode 100644
index 651d395c..00000000
--- a/ct/jellyfin-v3.sh
+++ /dev/null
@@ -1,365 +0,0 @@
-#!/usr/bin/env bash
-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}"
-CROSS="${RD}✗${CL}"
-APP="Jellyfin"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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 "${DGN}
- _ _ _ __ _
- | | | | | / _(_)
- | | ___| | |_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}Privileged${CL}"
- CT_TYPE="0"
- 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}8${CL}${DGN}GB${CL}"
- DISK_SIZE="8"
- echo -e "${DGN}Using ${BGN}2${CL}${DGN}vCPU${CL}"
- CORE_COUNT="2"
- echo -e "${DGN}Using ${BGN}2048${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="2048"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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 ${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}"
- else
- CT_TYPE1="Unprivileged"
- CT_TYPE="1"
- echo -en "${DGN}Set CT Type ${BL}Unprivileged${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: 8 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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;
-}
-
-PVE_CHECK
-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=$BRG,ip=$NET$GATE$VLAN
- -onboot 1
- -cores $CORE_COUNT
- -memory $RAM_SIZE
- -unprivileged $CT_TYPE
- $PW
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: c 226:0 rwm
-lxc.cgroup2.devices.allow: c 226:128 rwm
-lxc.cgroup2.devices.allow: c 29:0 rwm
-lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file
-lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
-lxc.mount.entry: /dev/dri/renderD128 dev/renderD128 none bind,optional,create=file
-EOF
-
-msg_info "Starting LXC Container"
-pct start $CTID
-msg_ok "Started LXC Container"
-
-lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/jellyfin-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 "Jellyfin Media Server should be reachable by going to the following URL.
- ${BL}http://${IP}:8096${CL}\n"
diff --git a/ct/jellyfin-v5.sh b/ct/jellyfin-v5.sh
new file mode 100644
index 00000000..b043cf38
--- /dev/null
+++ b/ct/jellyfin-v5.sh
@@ -0,0 +1,450 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ ____ _____
+ / /__ / / /_v5__/ __(_)___
+ __ / / _ \/ / / / / / /_/ / __ \
+/ /_/ / __/ / / /_/ / __/ / / / /
+\____/\___/_/_/\__, /_/ /_/_/ /_/
+ /____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Jellyfin"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="ubuntu"
+var_version="20.04"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
+ echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
+ CT_TYPE="0"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if var_version=$(whiptail --title "UBUNTU VERSION" --radiolist "Choose Version" 10 58 4 \
+ "18.04" "Bionic" OFF \
+ "20.04" "Focal" ON \
+ "22.04" "Jammy" OFF \
+ "22.10" "Kinetic" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"
+else
+ exit-script
+fi
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" OFF \
+ "0" "Privileged" ON \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /usr/lib/jellyfin ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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
+if [ "$CT_TYPE" == "0" ]; then
+ LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: c 226:0 rwm
+lxc.cgroup2.devices.allow: c 226:128 rwm
+lxc.cgroup2.devices.allow: c 29:0 rwm
+lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file
+lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
+lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file
+EOF
+fi
+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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8096${CL}\n"
diff --git a/ct/k0s-v5.sh b/ct/k0s-v5.sh
new file mode 100644
index 00000000..cdf959f6
--- /dev/null
+++ b/ct/k0s-v5.sh
@@ -0,0 +1,425 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ ____ __ __ __ __
+ / /__/ __ \_____ / //_/_ __/ /_ ___v5_________ ___ / /____ _____
+ / //_/ / / / ___/ / ,< / / / / __ \/ _ \/ ___/ __ \/ _ \/ __/ _ \/ ___/
+ / ,< / /_/ (__ ) / /| / /_/ / /_/ / __/ / / / / / __/ /_/ __(__ )
+/_/|_|\____/____/ /_/ |_\__,_/_.___/\___/_/ /_/ /_/\___/\__/\___/____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="k0s"
+var_disk="4"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/k0s/k0s.yaml ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/kavita-v5.sh b/ct/kavita-v5.sh
new file mode 100644
index 00000000..32c7b540
--- /dev/null
+++ b/ct/kavita-v5.sh
@@ -0,0 +1,426 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ __ _ __
+ / //_/___ __ v5__(_) /_____ _
+ / ,< / __ `/ | / / / __/ __ `/
+ / /| / /_/ /| |/ / / /_/ /_/ /
+/_/ |_\__,_/ |___/_/\__/\__,_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Kavita"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/Kavita ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:5000${CL} \n"
diff --git a/ct/keycloak-v3.sh b/ct/keycloak-v3.sh
deleted file mode 100644
index f78b5052..00000000
--- a/ct/keycloak-v3.sh
+++ /dev/null
@@ -1,355 +0,0 @@
-#!/usr/bin/env bash
-APP="Keycloak"
-var_disk="4"
-var_cpu="2"
-var_ram="2048"
-var_os="debian"
-var_version="11"
-NEXTID=$(pvesh get /cluster/nextid)
-INTEGER='^[0-9]+$'
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-var_install="${NSAPP}-install"
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-BGN=`echo "\033[4;92m"`
-GN=`echo "\033[1;92m"`
-DGN=`echo "\033[32m"`
-CL=`echo "\033[m"`
-BFR="\\r\\033[K"
-HOLD="-"
-CM="${GN}✓${CL}"
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-function msg_info() {
- local msg="$1"
- echo -ne " ${HOLD} ${YW}${msg}..."
-}
-
-function msg_ok() {
- local msg="$1"
- echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
-}
-
-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 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}$var_disk${CL}${DGN}GB${CL}"
- DISK_SIZE="$var_disk"
- echo -e "${DGN}Using ${BGN}$var_cpu${CL}${DGN}vCPU${CL}"
- CORE_COUNT="$var_cpu"
- echo -e "${DGN}Using ${BGN}$var_ram${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="$var_ram"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: $var_disk "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; 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}${DGN}GB${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}${DGN}GB${CL}"
- echo -e "${YW}Allocate CPU cores, or Press [ENTER] for Default: $var_cpu "
- read CORE_COUNT
- if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; fi;
- echo -en "${DGN}Set Cores To ${BL}$CORE_COUNT${CL}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: $var_ram "
- read RAM_SIZE
- if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; fi;
- echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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
-
-export CTID=$CT_ID
-export PCT_OSTYPE=$var_os
-export PCT_OSVERSION=$var_version
-export PCT_DISK_SIZE=$DISK_SIZE
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=$BRG,ip=$NET$GATE$VLAN
- -onboot 1
- -cores $CORE_COUNT
- -memory $RAM_SIZE
- -unprivileged $CT_TYPE
- $PW
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-msg_info "Starting LXC Container"
-pct start $CTID
-msg_ok "Started LXC Container"
-
-lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-msg_ok "Completed Successfully!\n"
-echo -e "${APP} should be reachable by going to the following URL.
- ${BL}http://${IP}:8080${CL} \n"
diff --git a/ct/keycloak-v5.sh b/ct/keycloak-v5.sh
new file mode 100644
index 00000000..7c2d8149
--- /dev/null
+++ b/ct/keycloak-v5.sh
@@ -0,0 +1,428 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ __ __ __
+ / //_/__v5__ _______/ /___ ____ _/ /__
+ / ,< / _ \/ / / / ___/ / __ \/ __ / //_/
+ / /| / __/ /_/ / /__/ / /_/ / /_/ / ,<
+/_/ |_\___/\__, /\___/_/\____/\__,_/_/|_|
+ /____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Keycloak"
+var_disk="4"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/keycloak.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8080${CL} \n"
diff --git a/ct/lidarr-v5.sh b/ct/lidarr-v5.sh
new file mode 100644
index 00000000..2fa8eab1
--- /dev/null
+++ b/ct/lidarr-v5.sh
@@ -0,0 +1,426 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ _ __
+ / / (_)___/ /___v5__________
+ / / / / __ / __ `/ ___/ ___/
+ / /___/ / /_/ / /_/ / / / /
+/_____/_/\__,_/\__,_/_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Lidarr"
+var_disk="4"
+var_cpu="2"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /var/lib/lidarr/ ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8686${CL} \n"
diff --git a/ct/magicmirror-v5.sh b/ct/magicmirror-v5.sh
new file mode 100644
index 00000000..87f20b9a
--- /dev/null
+++ b/ct/magicmirror-v5.sh
@@ -0,0 +1,429 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ ___ _ __ ____
+ / |/ /___ _____ _(_)____/ |/ (_)_____________ _____
+ / /|_/ / __ / __ / / ___/ /|_/ / / ___/ ___/ __ \/ ___/
+ / / / / /_/ / /_/ / / /__/ / / / / / / / / /_/ / /
+/_/ /_/\__,_/\__, /_/\___/_/ /_/_/_/ /_/ \____/_/
+ /____/ v5
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="MagicMirror"
+var_disk="3"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+cd /opt/magicmirror
+git pull &>/dev/null
+npm install --only=prod --omit=dev &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/magicmirror ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8080${CL} \n"
diff --git a/ct/mariadb-v1.sh b/ct/mariadb-v1.sh
deleted file mode 100644
index c3f09991..00000000
--- a/ct/mariadb-v1.sh
+++ /dev/null
@@ -1,168 +0,0 @@
-#!/usr/bin/env bash
-
-while true; do
- read -p "This will create a New Mariadb LXC Container. Proceed(y/n)?" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes or no.";;
- esac
-done
-clear
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-BL=`echo "\033[36m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-trap die ERR
-trap cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/mariadb_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using ${BL}${STORAGE}${CL} for Storage Location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "Container ID is ${BL}${CTID}${CL}."
-
-echo -en "${GN} Updating LXC Template List... "
-pveam update >/dev/null
-echo -e "${CM}${CL} \r"
-
-echo -en "${GN} Downloading LXC Template... "
-OSTYPE=debian
-OSVERSION=${OSTYPE}-11
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-echo -e "${CM}${CL} \r"
-
-echo -en "${GN} Creating LXC Container... "
-DISK_SIZE=4G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
-ARCH=$(dpkg --print-architecture)
-HOSTNAME=mariadb
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 1 -memory 1024 \
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-echo -e "${CM}${CL} \r"
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-pct push $CTID mariadb_setup.sh /mariadb_setup.sh -perms 755
-echo -e "${CM}${CL} \r"
-pct exec $CTID /mariadb_setup.sh
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "${GN} Successfully created a MariaDB LXC Container to ${BL}${CTID}${CL}"
-echo -e "${CL} Adminer should be reachable by going to the following URL.
- ${BL} http://${IP}/adminer/ ${CL}"
diff --git a/ct/mariadb-v2.sh b/ct/mariadb-v2.sh
deleted file mode 100644
index 233296d4..00000000
--- a/ct/mariadb-v2.sh
+++ /dev/null
@@ -1,252 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New Mariadb 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}
- __ __ _ _ _
- | \/ | (_) | | |
- | \ / | __ _ _ __ _ __ _ __| | |__
- | |\/| |/ _ | __| |/ _ |/ _ | _ \
- | | | | (_| | | | | (_| | (_| | |_) |
- |_| |_|\__,_|_| |_|\__,_|\__,_|_.__/
-
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=4
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname mariadb
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 1024
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/mariadb-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created Mariadb LXC to${CL} ${BL}$CTID${CL}.
-${BL}Adminer${CL} should be reachable by going to the following URL.
- ${BL}http://${IP}/adminer/${CL} \n"
diff --git a/ct/mariadb-v3.sh b/ct/mariadb-v3.sh
deleted file mode 100644
index 3925d8fc..00000000
--- a/ct/mariadb-v3.sh
+++ /dev/null
@@ -1,351 +0,0 @@
-#!/usr/bin/env bash
-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="MariaDB"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}4${CL}${DGN}GB${CL}"
- DISK_SIZE="4"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}1024${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="1024"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 4 "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="4"; 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: 1024 "
- read RAM_SIZE
- if [ -z $RAM_SIZE ]; then RAM_SIZE="1024"; fi;
- echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/mariadb-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 "Adminer should be reachable by going to the following URL.
- ${BL}http://${IP}/adminer/${CL} \n"
diff --git a/ct/mariadb-v5.sh b/ct/mariadb-v5.sh
new file mode 100644
index 00000000..2bee684d
--- /dev/null
+++ b/ct/mariadb-v5.sh
@@ -0,0 +1,425 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ ___ _ ____ ____
+ / |/ /___ ______(_)___ _/ __ \/ __ )
+ / /|_/ / __ / ___/ / __ / / / / __ |
+ / / / / /_/ / / / / /_/ / /_/ / /_/ /
+/_/ /_/\__,_/_/v5/_/\__,_/_____/_____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="MariaDB"
+var_disk="4"
+var_cpu="1"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/mariadb.list ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/meshcentral-v2.sh b/ct/meshcentral-v2.sh
deleted file mode 100644
index f8df0b17..00000000
--- a/ct/meshcentral-v2.sh
+++ /dev/null
@@ -1,258 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-APP="MeshCentral"
-HN=$(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}
- __ __ _ _____ _ _
- | \/ | | | / ____| | | | |
- | \ / | ___ ___| |__ | | ___ _ __ | |_ _ __ __ _| |
- | |\/| |/ _ \/ __| _ \| | / _ \ _ \| __| __/ _ | |
- | | | | __/\__ \ | | | |___| __/ | | | |_| | | (_| | |
- |_| |_|\___||___/_| |_|\_____\___|_| |_|\__|_| \__,_|_|
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=2
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 512
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some applications may not work properly due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$HN-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created ${APP} LXC to${CL} ${BL}$CTID${CL}.
-${APP} should be reachable by going to the following URL.
- ${BL}http://${IP}${CL} \n"
diff --git a/ct/meshcentral-v3.sh b/ct/meshcentral-v3.sh
deleted file mode 100644
index 1d6f2e1b..00000000
--- a/ct/meshcentral-v3.sh
+++ /dev/null
@@ -1,351 +0,0 @@
-#!/usr/bin/env bash
-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 ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}2${CL}${DGN}GB${CL}"
- DISK_SIZE="2"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}512${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="512"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 2 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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"
diff --git a/ct/meshcentral-v5.sh b/ct/meshcentral-v5.sh
new file mode 100644
index 00000000..0899b146
--- /dev/null
+++ b/ct/meshcentral-v5.sh
@@ -0,0 +1,427 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ ___ __ ______ __ __
+ / |/ /__ _____/ /_ / ____/__ ____ / /__________ _/ /
+ / /|_/ / _ \/ ___/ __ \/ / / _ \/ __ \/ __/ ___/ __ / /
+ / / / / __(__ ) / / / /___/ __/ / / / /_/ / / /_/ / /
+/_/ /_/\___/____/_/ /_/\____/\___/_/ /_/\__/_/ v5\__,_/_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="MeshCentral"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/meshcentral ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}${CL} \n"
diff --git a/ct/motioneye-v1.sh b/ct/motioneye-v1.sh
deleted file mode 100644
index 944ee9b6..00000000
--- a/ct/motioneye-v1.sh
+++ /dev/null
@@ -1,168 +0,0 @@
-#!/usr/bin/env bash
-
-while true; do
- read -p "This will create a New MotionEye NVR LXC Container. Proceed(y/n)?" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes or no.";;
- esac
-done
-
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
-trap die ERR
-trap cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/motioneye_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using '$STORAGE' for storage location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "Container ID is $CTID."
-
-echo -e "${CHECKMARK} \e[1;92m Updating LXC Template List... \e[0m"
-pveam update >/dev/null
-
-echo -e "${CHECKMARK} \e[1;92m Downloading LXC Template... \e[0m"
-OSTYPE=debian
-OSVERSION=${OSTYPE}-11
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-
-echo -e "${CHECKMARK} \e[1;92m Creating LXC Container... \e[0m"
-DISK_SIZE=8G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
-ARCH=$(dpkg --print-architecture)
-HOSTNAME=motioneye
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 2 -memory 2048\
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-
-echo -e "${CHECKMARK} \e[1;92m Starting LXC Container... \e[0m"
-pct start $CTID
-pct push $CTID motioneye_setup.sh /motioneye_setup.sh -perms 755
-pct exec $CTID /motioneye_setup.sh
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully Created MotionEye LXC to $CTID."
-echo -e "\e[1;92m MotionEye NVR should be reachable by going to the following URL.
- http://${IP}:8765
-\e[0m"
diff --git a/ct/motioneye-v2.sh b/ct/motioneye-v2.sh
deleted file mode 100644
index 0c3449b3..00000000
--- a/ct/motioneye-v2.sh
+++ /dev/null
@@ -1,258 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-APP="Motioneye"
-HN=$(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}
- __ __ ____ _______ _____ ____ _ _ ________ ________
- | \/ |/ __ \__ __|_ _/ __ \| \ | | ____\ \ / / ____|
- | \ / | | | | | | | || | | | \| | |__ \ \_/ /| |__
- | |\/| | | | | | | | || | | | | __| \ / | __|
- | | | | |__| | | | _| || |__| | |\ | |____ | | | |____
- |_| |_|\____/ |_| |_____\____/|_| \_|______| |_| |______|
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=8
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 2
- -memory 2048
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$HN-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created ${APP} LXC to${CL} ${BL}$CTID${CL}.
-${BL}${APP}${CL} should be reachable by going to the following URL.
- ${BL}http://${IP}:8765${CL} \n"
diff --git a/ct/motioneye-v3.sh b/ct/motioneye-v3.sh
deleted file mode 100644
index f83a2db8..00000000
--- a/ct/motioneye-v3.sh
+++ /dev/null
@@ -1,351 +0,0 @@
-#!/usr/bin/env bash
-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="Motioneye"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}8${CL}${DGN}GB${CL}"
- DISK_SIZE="8"
- echo -e "${DGN}Using ${BGN}2${CL}${DGN}vCPU${CL}"
- CORE_COUNT="2"
- echo -e "${DGN}Using ${BGN}2048${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="2048"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 8 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/motioneye-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}:8765${CL} \n"
diff --git a/ct/motioneye-v5.sh b/ct/motioneye-v5.sh
new file mode 100644
index 00000000..245f2439
--- /dev/null
+++ b/ct/motioneye-v5.sh
@@ -0,0 +1,426 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ ___ __ _
+ / |/ /___ / /_(_)___ ____v5___ __ _____
+ / /|_/ / __ \/ __/ / __ \/ __ \/ _ \/ / / / _ \
+ / / / / /_/ / /_/ / /_/ / / / / __/ /_/ / __/
+/_/ /_/\____/\__/_/\____/_/ /_/\___/\__, /\___/
+ /____/
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Motioneye"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+pip install motioneye --upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/motioneye.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8765${CL} \n"
diff --git a/ct/mqtt-v1.sh b/ct/mqtt-v1.sh
deleted file mode 100644
index bda6ed8e..00000000
--- a/ct/mqtt-v1.sh
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/usr/bin/env bash
-
-while true; do
- read -p "This will create a New MQTT LXC Container. Proceed(y/n)?" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes or no.";;
- esac
-done
-
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
-trap die ERR
-trap cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/mqtt_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using '$STORAGE' for storage location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "Container ID is $CTID."
-
-echo -e "${CHECKMARK} \e[1;92m Updating LXC Template List... \e[0m"
-pveam update >/dev/null
-
-echo -e "${CHECKMARK} \e[1;92m Downloading LXC Template... \e[0m"
-OSTYPE=debian
-OSVERSION=${OSTYPE}-11
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-
-echo -e "${CHECKMARK} \e[1;92m Creating LXC Container... \e[0m"
-DISK_SIZE=2G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
-ARCH=$(dpkg --print-architecture)
-HOSTNAME=mqtt
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 1 -memory 512 \
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-
-echo -e "${CHECKMARK} \e[1;92m Starting LXC Container... \e[0m"
-pct start $CTID
-pct push $CTID mqtt_setup.sh /mqtt_setup.sh -perms 755
-pct exec $CTID /mqtt_setup.sh
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully created a MQTT LXC Container to $CTID at IP Address ${IP}"
diff --git a/ct/mqtt-v2.sh b/ct/mqtt-v2.sh
deleted file mode 100644
index 7bd70ed0..00000000
--- a/ct/mqtt-v2.sh
+++ /dev/null
@@ -1,250 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New MQTT 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}
- __ __ ____ _______ _______
- | \/ |/ __ \__ __|__ __|
- | \ / | | | | | | | |
- | |\/| | | | | | | | |
- | | | | |__| | | | | |
- |_| |_|\___\_\ |_| |_|
-
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=2
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname mqtt
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 512
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/mqtt-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created MQTT LXC to${CL} ${BL}$CTID${CL}. \n"
diff --git a/ct/mqtt-v3.sh b/ct/mqtt-v3.sh
deleted file mode 100644
index 3c8c4d14..00000000
--- a/ct/mqtt-v3.sh
+++ /dev/null
@@ -1,349 +0,0 @@
-#!/usr/bin/env bash
-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="MQTT"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}2${CL}${DGN}GB${CL}"
- DISK_SIZE="2"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}512${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="512"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 2 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/mqtt-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"
diff --git a/ct/mqtt-v5.sh b/ct/mqtt-v5.sh
new file mode 100644
index 00000000..46cfed5f
--- /dev/null
+++ b/ct/mqtt-v5.sh
@@ -0,0 +1,424 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+ __ ___ ____ _ ____________
+ / |/ /___v5_____/ __ \__ __(_)_ __/_ __/___
+ / /|_/ / __ \/ ___/ / / / / / / / / / / / / __ \
+ / / / / /_/ (__ ) /_/ / /_/ / / / / / / / /_/ /
+/_/ /_/\____/____/\___\_\__,_/_/ /_/ /_/ \____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="MQTT"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/mosquitto-bullseye.list ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/n8n-v5.sh b/ct/n8n-v5.sh
new file mode 100644
index 00000000..13184630
--- /dev/null
+++ b/ct/n8n-v5.sh
@@ -0,0 +1,427 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ___
+ / _ \
+ _ __ | (_) |_v5_
+ | _ \ > _ <| _ \
+ | | | | (_) | | | |
+ |_| |_|\___/|_| |_|
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="n8n"
+var_disk="3"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+npm update -g n8n &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/n8n.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:5678${CL} \n"
diff --git a/ct/navidrome-v5.sh b/ct/navidrome-v5.sh
new file mode 100644
index 00000000..c5d4eeb2
--- /dev/null
+++ b/ct/navidrome-v5.sh
@@ -0,0 +1,437 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _ __ _ __
+ / | / /___ __ v5__(_)___/ /________ ____ ___ ___
+ / |/ / __ / | / / / __ / ___/ __ \/ __ __ \/ _ \
+ / /| / /_/ /| |/ / / /_/ / / / /_/ / / / / / / __/
+/_/ |_/\__,_/ |___/_/\__,_/_/ \____/_/ /_/ /_/\___/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Navidrome"
+var_disk="4"
+var_cpu="2"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+RELEASE=$(curl -s https://api.github.com/repos/navidrome/navidrome/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
+msg_info "Stopping ${APP}"
+systemctl stop navidrome.service
+msg_ok "Stopped Navidrome"
+
+msg_info "Updating to v${RELEASE}"
+wget https://github.com/navidrome/navidrome/releases/download/v${RELEASE}/navidrome_${RELEASE}_Linux_x86_64.tar.gz -O Navidrome.tar.gz &>/dev/null
+tar -xvzf Navidrome.tar.gz -C /opt/navidrome/ &>/dev/null
+msg_ok "Updated ${APP}"
+rm Navidrome.tar.gz
+
+msg_info "${GN} Starting ${APP}"
+systemctl start navidrome.service
+msg_ok "Started ${APP}"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/navidrome ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:4533${CL} \n"
diff --git a/ct/nextcloudpi-v5.sh b/ct/nextcloudpi-v5.sh
new file mode 100644
index 00000000..79ad1cff
--- /dev/null
+++ b/ct/nextcloudpi-v5.sh
@@ -0,0 +1,427 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _ __ __ ________ ______ _
+ / | / /__ _ __/ /_/ ____/ /___ __v5______/ / __ \(_)
+ / |/ / _ \| |/_/ __/ / / / __ \/ / / / __ / /_/ / /
+ / /| / __/> /_/ /___/ / /_/ / /_/ / /_/ / ____/ /
+/_/ |_/\___/_/|_|\__/\____/_/\____/\__,_/\__,_/_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="NextCloudPi"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
+ CT_TYPE="0"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /lib/systemd/system/nextcloud-domain.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} Setup should be reachable by going to the following URL.
+ ${BL}https://${IP}/${CL} \n"
diff --git a/ct/nginx-proxy-manager-v1.sh b/ct/nginx-proxy-manager-v1.sh
deleted file mode 100644
index efc67e28..00000000
--- a/ct/nginx-proxy-manager-v1.sh
+++ /dev/null
@@ -1,162 +0,0 @@
-#!/usr/bin/env bash
-
-#!/usr/bin/env bash
-while true; do
- read -p "This will create a New Nginx Proxy Manager LXC Container. Proceed(y/n)?" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes or no.";;
- esac
-done
-
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
-trap die ERR
-trap cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/npm_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using '$STORAGE' for storage location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "LXC ID is $CTID."
-
-echo -e "${CHECKMARK} \e[1;92m Updating LXC Template List... \e[0m"
-pveam update >/dev/null
-echo -e "${CHECKMARK} \e[1;92m Downloading LXC Template... \e[0m"
-OSTYPE=debian
-OSVERSION=${OSTYPE}-11
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-
-echo -e "${CHECKMARK} \e[1;92m Creating LXC... \e[0m"
-DISK_SIZE=3G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
-ARCH=$(dpkg --print-architecture)
-HOSTNAME=npm
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 1 -memory 1024 \
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-
-echo -e "${CHECKMARK} \e[1;92m Starting LXC... \e[0m"
-pct start $CTID
-pct push $CTID npm_setup.sh /npm_setup.sh -perms 755
-pct exec $CTID /npm_setup.sh
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully Created Nginx Proxy Manager LXC to $CTID."
-echo -e "\e[1;92m Nginx Proxy Manager should be reachable by going to the following URL.
- http://${IP}:81
-\e[0m"
diff --git a/ct/nginx-proxy-manager-v2.sh b/ct/nginx-proxy-manager-v2.sh
deleted file mode 100644
index 2b147d60..00000000
--- a/ct/nginx-proxy-manager-v2.sh
+++ /dev/null
@@ -1,251 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New Nginx Proxy Manager 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}
- _ _ _____ __ __
- | \ | | __ \| \/ |
- | \| | |__) | \ / |
- | | ___/| |\/| |
- | |\ | | | | | |
- |_| \_|_| |_| |_|
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=3
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname npm
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 1024
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/nginx-proxy-manager-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created Nginx Proxy Manager LXC to${CL} ${BL}$CTID${CL}.
-Nginx Proxy Manager should be reachable by going to the following URL.
- ${BL}http://${IP}:81${CL} \n"
diff --git a/ct/nginx-proxy-manager-v3.sh b/ct/nginx-proxy-manager-v3.sh
deleted file mode 100644
index 40c4bba5..00000000
--- a/ct/nginx-proxy-manager-v3.sh
+++ /dev/null
@@ -1,351 +0,0 @@
-#!/usr/bin/env bash
-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="Nginx Proxy Manager"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}3${CL}${DGN}GB${CL}"
- DISK_SIZE="3"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}1024${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="1024"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 3 "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="3"; 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: 1024 "
- read RAM_SIZE
- if [ -z $RAM_SIZE ]; then RAM_SIZE="1024"; fi;
- echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/nginx-proxy-manager-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}:81${CL} \n"
diff --git a/ct/nginxproxymanager-v5.sh b/ct/nginxproxymanager-v5.sh
new file mode 100644
index 00000000..1d22c093
--- /dev/null
+++ b/ct/nginxproxymanager-v5.sh
@@ -0,0 +1,536 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _ __ _ ____ __ ___
+ / | / /___ _(_)___ _ __ / __ \_________v5_ ____ __ / |/ /___ _____ ____ _____ ____ _____
+ / |/ / __ / / __ \| |/_/ / /_/ / ___/ __ \| |/_/ / / / / /|_/ / __ / __ \/ __ / __ / _ \/ ___/
+ / /| / /_/ / / / / /> < / ____/ / / /_/ /> /_/ / / / / / /_/ / / / / /_/ / /_/ / __/ /
+/_/ |_/\__, /_/_/ /_/_/|_| /_/ /_/ \____/_/|_|\__, / /_/ /_/\__,_/_/ /_/\__,_/\__, /\___/_/
+ /____/ /____/ /____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Nginx Proxy Manager"
+var_disk="4"
+var_cpu="1"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+RELEASE=$(curl -s https://api.github.com/repos/NginxProxyManager/nginx-proxy-manager/releases/latest |
+ grep "tag_name" |
+ awk '{print substr($2, 3, length($2)-4) }')
+
+msg_info "Stopping Services"
+systemctl stop openresty
+systemctl stop npm
+msg_ok "Stopped Services"
+
+msg_info "Cleaning Old Files"
+ rm -rf /app \
+ /var/www/html \
+ /etc/nginx \
+ /var/log/nginx \
+ /var/lib/nginx \
+ /var/cache/nginx &>/dev/null
+msg_ok "Cleaned Old Files"
+
+msg_info "Downloading NPM v${RELEASE}"
+wget -q https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v${RELEASE} -O - | tar -xz &>/dev/null
+cd nginx-proxy-manager-${RELEASE}
+msg_ok "Downloaded NPM v${RELEASE}"
+
+msg_info "Setting up Enviroment"
+ln -sf /usr/bin/python3 /usr/bin/python
+ln -sf /usr/bin/certbot /opt/certbot/bin/certbot
+ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx
+ln -sf /usr/local/openresty/nginx/ /etc/nginx
+sed -i "s+0.0.0+${RELEASE}+g" backend/package.json
+sed -i "s+0.0.0+${RELEASE}+g" frontend/package.json
+sed -i 's+^daemon+#daemon+g' docker/rootfs/etc/nginx/nginx.conf
+NGINX_CONFS=$(find "$(pwd)" -type f -name "*.conf")
+for NGINX_CONF in $NGINX_CONFS; do
+ sed -i 's+include conf.d+include /etc/nginx/conf.d+g' "$NGINX_CONF"
+done
+mkdir -p /var/www/html /etc/nginx/logs
+cp -r docker/rootfs/var/www/html/* /var/www/html/
+cp -r docker/rootfs/etc/nginx/* /etc/nginx/
+cp docker/rootfs/etc/letsencrypt.ini /etc/letsencrypt.ini
+cp docker/rootfs/etc/logrotate.d/nginx-proxy-manager /etc/logrotate.d/nginx-proxy-manager
+ln -sf /etc/nginx/nginx.conf /etc/nginx/conf/nginx.conf
+rm -f /etc/nginx/conf.d/dev.conf
+mkdir -p /tmp/nginx/body \
+ /run/nginx \
+ /data/nginx \
+ /data/custom_ssl \
+ /data/logs \
+ /data/access \
+ /data/nginx/default_host \
+ /data/nginx/default_www \
+ /data/nginx/proxy_host \
+ /data/nginx/redirection_host \
+ /data/nginx/stream \
+ /data/nginx/dead_host \
+ /data/nginx/temp \
+ /var/lib/nginx/cache/public \
+ /var/lib/nginx/cache/private \
+ /var/cache/nginx/proxy_temp
+chmod -R 777 /var/cache/nginx
+chown root /tmp/nginx
+echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf);" >/etc/nginx/conf.d/include/resolvers.conf
+if [ ! -f /data/nginx/dummycert.pem ] || [ ! -f /data/nginx/dummykey.pem ]; then
+ echo -e "${CHECKMARK} \e[1;92m Generating dummy SSL Certificate... \e[0m"
+ openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 -subj "/O=Nginx Proxy Manager/OU=Dummy Certificate/CN=localhost" -keyout /data/nginx/dummykey.pem -out /data/nginx/dummycert.pem &>/dev/null
+fi
+mkdir -p /app/global /app/frontend/images
+cp -r backend/* /app
+cp -r global/* /app/global
+msg_ok "Setup Enviroment"
+
+msg_info "Building Frontend"
+cd ./frontend
+export NODE_ENV=development
+yarn install --network-timeout=30000 &>/dev/null
+yarn build &>/dev/null
+cp -r dist/* /app/frontend
+cp -r app-images/* /app/frontend/images
+msg_ok "Built Frontend"
+
+
+msg_info "Initializing Backend"
+rm -rf /app/config/default.json &>/dev/null
+if [ ! -f /app/config/production.json ]; then
+ cat <<'EOF' >/app/config/production.json
+{
+ "database": {
+ "engine": "knex-native",
+ "knex": {
+ "client": "sqlite3",
+ "connection": {
+ "filename": "/data/database.sqlite"
+ }
+ }
+ }
+}
+EOF
+fi
+cd /app
+export NODE_ENV=development
+yarn install --network-timeout=30000 &>/dev/null
+msg_ok "Initialized Backend"
+
+msg_info "Starting Services"
+systemctl enable npm &>/dev/null
+systemctl start openresty
+systemctl start npm
+msg_ok "Started Services"
+
+msg_info "Cleaning up"
+rm -rf ~/nginx-proxy-manager-*
+msg_ok "Cleaned"
+
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /lib/systemd/system/npm.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:81${CL} \n"
diff --git a/ct/nocodb-v2.sh b/ct/nocodb-v2.sh
deleted file mode 100644
index 4eafd1cf..00000000
--- a/ct/nocodb-v2.sh
+++ /dev/null
@@ -1,258 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-APP="NocoDB"
-HN=$(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}
- _ _ _____ ____
- | \ | | | __ \| _ \
- | \| | ___ ___ ___ | | | | |_) |
- | |/ _ \ / __/ _ \| | | | _ <
- | |\ | (_) | (_| (_) | |__| | |_) |
- |_| \_|\___/ \___\___/|_____/|____/
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=4
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 1024
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some applications may not work properly due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$HN-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created ${APP} LXC to${CL} ${BL}$CTID${CL}.
-${BL}${APP}${CL} should be reachable by going to the following URL.
- ${BL}http://${IP}:8080/dashboard${CL}\n"
diff --git a/ct/nocodb-v3.sh b/ct/nocodb-v3.sh
deleted file mode 100644
index c32a23a4..00000000
--- a/ct/nocodb-v3.sh
+++ /dev/null
@@ -1,351 +0,0 @@
-#!/usr/bin/env bash
-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="NocoDB"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}4${CL}${DGN}GB${CL}"
- DISK_SIZE="4"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}1024${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="1024"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 4 "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="4"; 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: 1024 "
- read RAM_SIZE
- if [ -z $RAM_SIZE ]; then RAM_SIZE="1024"; fi;
- echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/nocodb-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}:8080/dashboard${CL}\n"
diff --git a/ct/nocodb-v5.sh b/ct/nocodb-v5.sh
new file mode 100644
index 00000000..50b929cb
--- /dev/null
+++ b/ct/nocodb-v5.sh
@@ -0,0 +1,429 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _ __ ____ ____
+ / | / /___ ____v5___ / __ \/ __ )
+ / |/ / __ \/ ___/ __ \/ / / / __ |
+ / /| / /_/ / /__/ /_/ / /_/ / /_/ /
+/_/ |_/\____/\___/\____/_____/_____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="NocoDB"
+var_disk="4"
+var_cpu="1"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP}"
+cd /opt/nocodb
+npm uninstall -s --save nocodb &>/dev/null
+npm install -s --save nocodb &>/dev/null
+systemctl restart nocodb.service
+msg_ok "Updated ${APP}"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/nocodb.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8080/dashboard${CL} \n"
diff --git a/ct/node-red-v1.sh b/ct/node-red-v1.sh
deleted file mode 100644
index ebd544b3..00000000
--- a/ct/node-red-v1.sh
+++ /dev/null
@@ -1,161 +0,0 @@
-#!/usr/bin/env bash
-
-while true; do
- read -p "This will create a New Node-Red LXC Container. Proceed(y/n)?" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes or no.";;
- esac
-done
-clear
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
-trap die ERR
-trap cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/node-red_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using '$STORAGE' for storage location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "Container ID is $CTID."
-
-echo -e "${CHECKMARK} \e[1;92m Updating LXC Template List... \e[0m"
-pveam update >/dev/null
-echo -e "${CHECKMARK} \e[1;92m Downloading LXC Template... \e[0m"
-OSTYPE=debian
-OSVERSION=${OSTYPE}-11
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-
-echo -e "${CHECKMARK} \e[1;92m Creating LXC Container... \e[0m"
-DISK_SIZE=4G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
-ARCH=$(dpkg --print-architecture)
-HOSTNAME=nodered
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 1 -memory 1024 \
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-
-echo -e "${CHECKMARK} \e[1;92m Starting LXC Container... \e[0m"
-pct start $CTID
-pct push $CTID node-red_setup.sh /node-red_setup.sh -perms 755
-pct exec $CTID /node-red_setup.sh
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully Created Node-Red LXC to $CTID."
-echo -e "\e[1;92m Node-Red should be reachable by going to the following URL.
- http://${IP}:1880
-\e[0m"
diff --git a/ct/node-red-v2.sh b/ct/node-red-v2.sh
deleted file mode 100644
index 9ecc7d17..00000000
--- a/ct/node-red-v2.sh
+++ /dev/null
@@ -1,253 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New Node-Red 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}
- _ _ _ _____ _
- | \ | | | | | __ \ | |
- | \| | ___ __| | ___ ______| |__) |___ __| |
- | |/ _ \ / _ |/ _ \______| _ // _ \/ _ |
- | |\ | (_) | (_| | __/ | | \ \ __/ (_| |
- |_| \_|\___/ \__,_|\___| |_| \_\___|\__,_|
-
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=4
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname node-red
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 1024
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/node-red-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created Node-Red LXC to${CL} ${BL}$CTID${CL}.
-${RD}Node-Red${CL} should be reachable by going to the following URL.
-
- ${BL}http://${IP}:1880${CL} \n"
diff --git a/ct/node-red-v3.sh b/ct/node-red-v3.sh
deleted file mode 100644
index cbd8e44b..00000000
--- a/ct/node-red-v3.sh
+++ /dev/null
@@ -1,351 +0,0 @@
-#!/usr/bin/env bash
-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="Node Red"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}4${CL}${DGN}GB${CL}"
- DISK_SIZE="4"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}1024${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="1024"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 4 "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="4"; 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: 1024 "
- read RAM_SIZE
- if [ -z $RAM_SIZE ]; then RAM_SIZE="1024"; fi;
- echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/node-red-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}:1880${CL} \n"
diff --git a/ct/node-red-v5.sh b/ct/node-red-v5.sh
new file mode 100644
index 00000000..e0a5fbf4
--- /dev/null
+++ b/ct/node-red-v5.sh
@@ -0,0 +1,462 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _ __ __ ____ __
+ / | / /___ ____/ /__ v5 / __ \___ ____/ /
+ / |/ / __ \/ __ / _ \ / /_/ / _ \/ __ /
+ / /| / /_/ / /_/ / __/ / _, _/ __/ /_/ /
+/_/ |_/\____/\__,_/\___/ /_/ |_|\___/\__,_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Node-Red"
+var_disk="4"
+var_cpu="1"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+UPD=$(whiptail --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 2 \
+ "1" "Update ${APP}" ON \
+ "2" "Install Themes" OFF \
+ 3>&1 1>&2 2>&3)
+header_info
+if [ "$UPD" == "1" ]; then
+msg_info "Stopping ${APP}"
+systemctl stop nodered
+msg_ok "Stopped ${APP}"
+
+msg_info "Updating ${APP}"
+npm install -g --unsafe-perm node-red &>/dev/null
+msg_ok "Updated ${APP}"
+
+msg_info "Starting ${APP}"
+systemctl start nodered
+msg_ok "Started ${APP}"
+msg_ok "Update Successful"
+exit
+fi
+if [ "$UPD" == "2" ]; then
+THEME=$(whiptail --title "NODE-RED THEMES" --radiolist --cancel-button Exit-Script "Choose Theme" 15 58 6 \
+ "dark" "" OFF \
+ "dracula" "" OFF \
+ "midnight-red" "" ON \
+ "oled" "" OFF \
+ "solarized-dark" "" OFF \
+ "solarized-light" "" OFF \
+ 3>&1 1>&2 2>&3)
+header_info
+msg_info "Installing ${THEME} Theme"
+cd /root/.node-red
+sed -i 's|//theme: "",|theme: "",|g' /root/.node-red/settings.js
+npm install @node-red-contrib-themes/${THEME} &>/dev/null
+sed -i "{s/theme: ".*"/theme: '${THEME}',/g}" /root/.node-red/settings.js
+msg_ok "Installed ${THEME} Theme"
+
+msg_info "Restarting ${APP}"
+systemctl restart nodered
+msg_ok "Restarted ${APP}"
+exit
+fi
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /root/.node-red ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:1880${CL} \n"
diff --git a/ct/omada-v2.sh b/ct/omada-v2.sh
deleted file mode 100644
index 6ec8036b..00000000
--- a/ct/omada-v2.sh
+++ /dev/null
@@ -1,252 +0,0 @@
-#!/usr/bin/env bash
-clear
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New Omada Controller 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}
- ____ _ _____ _ _ _
- / __ \ | | / ____| | | | | |
- | | | |_ __ ___ __ _ __| | __ _ | | ___ _ __ | |_ _ __ ___ | | | ___ _ __
- | | | | _ _ \ / _ |/ _ |/ _ | | | / _ \| _ \| __| __/ _ \| | |/ _ \ __|
- | |__| | | | | | | (_| | (_| | (_| | | |___| (_) | | | | |_| | | (_) | | | __/ |
- \____/|_| |_| |_|\__,_|\__,_|\__,_| \_____\___/|_| |_|\__|_| \___/|_|_|\___|_|
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose an Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=ubuntu
-export PCT_OSVERSION=20.04
-export PCT_DISK_SIZE=8
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname omada
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 2
- -memory 2048
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd 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}')
-
-echo -e "${GN}Successfully created Omada Controller LXC to${CL} ${BL}$CTID${CL}.
-${BL}Omada${CL} should be reachable by going to the following URL.
- ${BL}https://${IP}:8043${CL} \n"
diff --git a/ct/omada-v3.sh b/ct/omada-v3.sh
deleted file mode 100644
index be57d41d..00000000
--- a/ct/omada-v3.sh
+++ /dev/null
@@ -1,351 +0,0 @@
-#!/usr/bin/env bash
-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 ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}8${CL}${DGN}GB${CL}"
- DISK_SIZE="8"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="2"
- echo -e "${DGN}Using ${BGN}512${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="2048"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 8 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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"
diff --git a/ct/omada-v5.sh b/ct/omada-v5.sh
new file mode 100644
index 00000000..c9b9defc
--- /dev/null
+++ b/ct/omada-v5.sh
@@ -0,0 +1,439 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __
+ / __ \____ ___v5____ _____/ /___ _
+ / / / / __ __ \/ __ / __ / __ /
+/ /_/ / / / / / / /_/ / /_/ / /_/ /
+\____/_/ /_/ /_/\__,_/\__,_/\__,_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Omada"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="ubuntu"
+var_version="20.04"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if var_version=$(whiptail --title "UBUNTU VERSION" --radiolist "Choose Version" 10 58 4 \
+ "18.04" "Bionic" OFF \
+ "20.04" "Focal" ON \
+ "22.04" "Jammy" OFF \
+ "22.10" "Kinetic" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"
+else
+ exit-script
+fi
+
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/tplink ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}https://${IP}:8043${CL} \n"
diff --git a/ct/omv-v5.sh b/ct/omv-v5.sh
new file mode 100644
index 00000000..692f323b
--- /dev/null
+++ b/ct/omv-v5.sh
@@ -0,0 +1,438 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __ ___ ___ _ __ ____
+ / __ \____v5___ ____ / |/ /__ ____/ (_)___ | | / /___ ___ __/ / /_
+ / / / / __ \/ _ \/ __ \/ /|_/ / _ \/ __ / / __ `/ | / / __ `/ / / / / __/
+/ /_/ / /_/ / __/ / / / / / / __/ /_/ / / /_/ /| |/ / /_/ / /_/ / / /_
+\____/ .___/\___/_/ /_/_/ /_/\___/\__,_/_/\__,_/ |___/\__,_/\__,_/_/\__/
+ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="OMV"
+var_disk="4"
+var_cpu="2"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
+ CT_TYPE="0"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/openmediavault.list ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -onboot 1
+ -cores $CORE_COUNT
+ -memory $RAM_SIZE
+ -unprivileged $CT_TYPE
+ $PW
+"
+bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
+LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: a
+lxc.cap.drop:
+lxc.cgroup2.devices.allow: c 188:* rwm
+lxc.cgroup2.devices.allow: c 189:* rwm
+lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
+lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
+EOF
+msg_info "Starting LXC Container"
+pct start $CTID
+msg_ok "Started LXC Container"
+lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}${CL} \n"
diff --git a/ct/openhab-v5.sh b/ct/openhab-v5.sh
new file mode 100644
index 00000000..45150c44
--- /dev/null
+++ b/ct/openhab-v5.sh
@@ -0,0 +1,428 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ _____ ____
+ ____v5____ ___ ____ / / / / | / __ )
+ / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __ |
+/ /_/ / /_/ / __/ / / / __ / ___ |/ /_/ /
+\____/ .___/\___/_/ /_/_/ /_/_/ |_/_____/
+ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="openHAB"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/openhab.list ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8080${CL} \n"
diff --git a/ct/paperless-ngx-v5.sh b/ct/paperless-ngx-v5.sh
new file mode 100644
index 00000000..88b62649
--- /dev/null
+++ b/ct/paperless-ngx-v5.sh
@@ -0,0 +1,495 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __
+ / __ \____ _____ ___ _____/ /__v5__________ ____ ____ __ __
+ / /_/ / __ `/ __ \/ _ \/ ___/ / _ \/ ___/ ___/___/ __ \/ __ `/ |/_/
+ / ____/ /_/ / /_/ / __/ / / / __(__ |__ )___/ / / / /_/ /> <
+/_/ \__,_/ .___/\___/_/ /_/\___/____/____/ /_/ /_/\__, /_/|_|
+ /_/ /____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Paperless-ngx"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+RELEASE=$(curl -s https://api.github.com/repos/paperless-ngx/paperless-ngx/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
+SER=/etc/systemd/system/paperless-task-queue.service
+
+UPD=$(whiptail --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 2 \
+ "1" "Update Paperless-ngx to $RELEASE" ON \
+ "2" "Paperless-ngx Credentials" OFF \
+ 3>&1 1>&2 2>&3)
+header_info
+if [ "$UPD" == "1" ]; then
+msg_info "Stopping Paperless-ngx"
+systemctl stop paperless-consumer paperless-webserver paperless-scheduler
+ if [ -f "$SER" ]; then
+ systemctl stop paperless-task-queue.service
+ fi
+sleep 1
+msg_ok "Stopped Paperless-ngx"
+
+msg_info "Updating to ${RELEASE}"
+ if [ "$(dpkg -l | awk '/libmariadb-dev-compat/ {print }'|wc -l)" != 1 ]; then apt-get install -y libmariadb-dev-compat; fi &>/dev/null
+ wget https://github.com/paperless-ngx/paperless-ngx/releases/download/$RELEASE/paperless-ngx-$RELEASE.tar.xz &>/dev/null
+ tar -xf paperless-ngx-$RELEASE.tar.xz &>/dev/null
+ cp -r /opt/paperless/paperless.conf paperless-ngx/
+ cp -r paperless-ngx/* /opt/paperless/
+ cd /opt/paperless
+ sed -i -e 's|-e git+https://github.com/paperless-ngx/django-q.git|git+https://github.com/paperless-ngx/django-q.git|' /opt/paperless/requirements.txt
+ pip install -r requirements.txt &>/dev/null
+ cd /opt/paperless/src
+ /usr/bin/python3 manage.py migrate &>/dev/null
+ if [ -f "$SER" ]; then
+ msg_ok "paperless-task-queue.service Exists."
+ else
+cat </etc/systemd/system/paperless-task-queue.service
+[Unit]
+Description=Paperless Celery Workers
+Requires=redis.service
+[Service]
+WorkingDirectory=/opt/paperless/src
+ExecStart=celery --app paperless worker --loglevel INFO
+[Install]
+WantedBy=multi-user.target
+EOF
+systemctl enable paperless-task-queue &>/dev/null
+msg_ok "paperless-task-queue.service Created."
+ fi
+cat </etc/systemd/system/paperless-scheduler.service
+[Unit]
+Description=Paperless Celery beat
+Requires=redis.service
+[Service]
+WorkingDirectory=/opt/paperless/src
+ExecStart=celery --app paperless beat --loglevel INFO
+[Install]
+WantedBy=multi-user.target
+EOF
+msg_ok "Updated to ${RELEASE}"
+
+msg_info "Cleaning up"
+cd ~
+rm paperless-ngx-$RELEASE.tar.xz
+rm -rf paperless-ngx
+msg_ok "Cleaned"
+
+msg_info "Starting Paperless-ngx"
+systemctl daemon-reload
+systemctl start paperless-consumer paperless-webserver paperless-scheduler paperless-task-queue.service
+sleep 1
+msg_ok "Started Paperless-ngx"
+msg_ok "Updated Successfully!\n"
+exit
+fi
+if [ "$UPD" == "2" ]; then
+cat paperless.creds
+exit
+fi
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/paperless ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8000${CL} \n"
diff --git a/ct/photoprism-v2.sh b/ct/photoprism-v2.sh
deleted file mode 100644
index 31035d89..00000000
--- a/ct/photoprism-v2.sh
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-PP=`echo "\e[1;35m"`
-APP="PhotoPrism"
-HN=$(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 "${PP}
- _____ _ _ _____ _
- | __ \| | | | | __ \ (_)
- | |__) | |__ ___ | |_ ___ | |__) | __ _ ___ _ __ ___
- | ___/| _ \ / _ \| __/ _ \| ___/ __| / __| _ _ \
- | | | | | | (_) | || (_) | | | | | \__ \ | | | | |
- |_| |_| |_|\___/ \__\___/|_| |_| |_|___/_| |_| |_|
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=8
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 2
- -memory 2048
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$HN-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created ${APP} LXC to${CL} ${BL}$CTID${CL}.
-${APP} should be reachable by going to the following URL.
- ${BL}http://${IP}:2342${CL} \n"
diff --git a/ct/photoprism-v3.sh b/ct/photoprism-v3.sh
deleted file mode 100644
index c77bd81c..00000000
--- a/ct/photoprism-v3.sh
+++ /dev/null
@@ -1,352 +0,0 @@
-#!/usr/bin/env bash
-NEXTID=$(pvesh get /cluster/nextid)
-INTEGER='^[0-9]+$'
-PP=`echo "\e[1;35m"`
-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="PhotoPrism"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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 "${PP}
- _____ _ _ _____ _
- | __ \| | | | | __ \ (_)
- | |__) | |__ ___ | |_ ___ | |__) | __ _ ___ _ __ ___
- | ___/| _ \ / _ \| __/ _ \| ___/ __| / __| _ _ \
- | | | | | | (_) | || (_) | | | | | \__ \ | | | | |
- |_| 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}8${CL}${DGN}GB${CL}"
- DISK_SIZE="8"
- echo -e "${DGN}Using ${BGN}2${CL}${DGN}vCPU${CL}"
- CORE_COUNT="2"
- echo -e "${DGN}Using ${BGN}2048${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="2048"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 8 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/photoprism-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}:2342${CL} \n"
diff --git a/ct/photoprism-v5.sh b/ct/photoprism-v5.sh
new file mode 100644
index 00000000..f128744e
--- /dev/null
+++ b/ct/photoprism-v5.sh
@@ -0,0 +1,452 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __ ______ __________ ____ ____ _________ __ ___
+ / __ \/ / / / __ \/_ __/ __ \/ __ \/ __ \/ _/ ___// |/ /
+ / /_/ / /_/ / / / / / / / / / / /_/ / /_/ // / \__ \/ /|_/ /
+ / ____/ __ / /_/ / / / / /_/ / ____/ _, _// / v5_/ / / / /
+/_/ /_/ /_/\____/ /_/ \____/_/ /_/ |_/___//____/_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="PhotoPrism"
+var_disk="8"
+var_cpu="4"
+var_ram="4096"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+echo -e "\n ⚠️ Ensure you set 2vCPU & 3072MiB RAM MIMIMUM!!! \n"
+msg_info "Stopping PhotoPrism"
+sudo systemctl stop photoprism
+msg_ok "Stopped PhotoPrism"
+
+msg_info "Cloning PhotoPrism"
+git clone https://github.com/photoprism/photoprism.git &>/dev/null
+cd photoprism
+git checkout release &>/dev/null
+msg_ok "Cloned PhotoPrism"
+
+msg_info "Building PhotoPrism"
+sudo make all &>/dev/null
+sudo ./scripts/build.sh prod /opt/photoprism/bin/photoprism &>/dev/null
+sudo rm -rf /opt/photoprism/assets
+sudo cp -r assets/ /opt/photoprism/ &>/dev/null
+msg_ok "Built PhotoPrism"
+
+msg_info "Cleaning"
+cd ~
+rm -rf photoprism
+msg_ok "Cleaned"
+
+msg_info "Starting PhotoPrism"
+sudo systemctl start photoprism
+msg_ok "Started PhotoPrism"
+msg_ok "Update Successful"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/photoprism ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_info "Setting Container to Normal Resources"
+pct set $CTID -memory 2048
+msg_ok "Set Container to Normal Resources"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:2342${CL} \n"
diff --git a/ct/pihole-v1.sh b/ct/pihole-v1.sh
deleted file mode 100644
index 1d420089..00000000
--- a/ct/pihole-v1.sh
+++ /dev/null
@@ -1,162 +0,0 @@
-#!/usr/bin/env bash
-
-while true; do
- read -p "This will create a New Pi-hole LXC. Proceed(y/n)?" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes or no.";;
- esac
-done
-
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
-trap die ERR
-trap cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/pihole_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using '$STORAGE' for storage location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "LXC ID is $CTID."
-
-echo -e "${CHECKMARK} \e[1;92m Updating LXC Template List... \e[0m"
-pveam update >/dev/null
-
-echo -e "${CHECKMARK} \e[1;92m Downloading LXC Template... \e[0m"
-OSTYPE=debian
-OSVERSION=${OSTYPE}-11
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-
-echo -e "${CHECKMARK} \e[1;92m Creating LXC... \e[0m"
-DISK_SIZE=2G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
-ARCH=$(dpkg --print-architecture)
-HOSTNAME=pi-hole
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 1 -memory 512 \
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-
-echo -e "${CHECKMARK} \e[1;92m Starting LXC... \e[0m"
-pct start $CTID
-pct push $CTID pihole_setup.sh /pihole_setup.sh -perms 755
-pct exec $CTID /pihole_setup.sh
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully created a Pi-hole LXC to $CTID"
-echo -e "\e[1;92m Pi-hole should be reachable by going to the following URL.
- http://${IP}
-\e[0m"
diff --git a/ct/pihole-v2.sh b/ct/pihole-v2.sh
deleted file mode 100644
index 9a0abcdd..00000000
--- a/ct/pihole-v2.sh
+++ /dev/null
@@ -1,258 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-APP="Pihole"
-HN=$(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}
- _____ _____ _ _ ____ _ ______
- | __ \_ _| | | |/ __ \| | | ____|
- | |__) || | | |__| | | | | | | |__
- | ___/ | | | __ | | | | | | __|
- | | _| |_| | | | |__| | |____| |____
- |_| |_____|_| |_|\____/|______|______|
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=2
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 512
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$HN-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created ${APP} LXC to${CL} ${BL}$CTID${CL}.
-${BL}${APP}${CL} should be reachable by going to the following URL.
- ${BL}http://${IP}${CL} \n"
diff --git a/ct/pihole-v3.sh b/ct/pihole-v3.sh
deleted file mode 100644
index 3e513be3..00000000
--- a/ct/pihole-v3.sh
+++ /dev/null
@@ -1,351 +0,0 @@
-#!/usr/bin/env bash
-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 ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}2${CL}${DGN}GB${CL}"
- DISK_SIZE="2"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}512${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="512"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 2 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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"
diff --git a/ct/pihole-v5.sh b/ct/pihole-v5.sh
new file mode 100644
index 00000000..f4e541af
--- /dev/null
+++ b/ct/pihole-v5.sh
@@ -0,0 +1,427 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ ____ __ ______ __ ______
+ / __ \/ _/ / / / / __ \/ / / ____/
+ / /_/ // /___/ /_/ / / / / / / __/
+ / ____// /___/ __ / /_/ / /v5_/ /___
+/_/ /___/ /_/ /_/\____/_____/_____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Pihole"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /etc/pihole ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}/admin${CL} \n"
diff --git a/ct/plex-v1.sh b/ct/plex-v1.sh
deleted file mode 100644
index 68949613..00000000
--- a/ct/plex-v1.sh
+++ /dev/null
@@ -1,170 +0,0 @@
-#!/usr/bin/env bash
-
-while true; do
- read -p "This will create a New Plex Media Server LXC Container. Proceed(y/n)?" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes or no.";;
- esac
-done
-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
-CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
-trap cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/plex_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using '$STORAGE' for Storage Location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "Container ID is $CTID."
-
-echo -e "${CHECKMARK} \e[1;92m Updating LXC Template List... \e[0m"
-pveam update >/dev/null
-echo -e "${CHECKMARK} \e[1;92m Downloading LXC Template... \e[0m"
-OSTYPE=ubuntu
-OSVERSION=${OSTYPE}-20.04
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-
-echo -e "${CHECKMARK} \e[1;92m Creating LXC Container... \e[0m"
-DISK_SIZE=8G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
-ARCH=$(dpkg --print-architecture)
-HOSTNAME=plex
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 2 -memory 2048\
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: c 226:0 rwm
-lxc.cgroup2.devices.allow: c 226:128 rwm
-lxc.cgroup2.devices.allow: c 29:0 rwm
-lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file
-lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
-lxc.mount.entry: /dev/dri/renderD128 dev/renderD128 none bind,optional,create=file
-EOF
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-
-echo -e "${CHECKMARK} \e[1;92m Starting LXC Container... \e[0m"
-pct start $CTID
-pct push $CTID plex_setup.sh /plex_setup.sh -perms 755
-pct exec $CTID /plex_setup.sh
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully Created Plex Media Server LXC to $CTID."
-echo -e "\e[1;92m Plex Media Server should be reachable by going to the following URL.
- http://${IP}:32400/web
-\e[0m"
diff --git a/ct/plex-v3.sh b/ct/plex-v3.sh
deleted file mode 100644
index 96fac292..00000000
--- a/ct/plex-v3.sh
+++ /dev/null
@@ -1,363 +0,0 @@
-#!/usr/bin/env bash
-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}"
-CROSS="${RD}✗${CL}"
-APP="Plex"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}Privileged${CL}"
- CT_TYPE="0"
- 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}8${CL}${DGN}GB${CL}"
- DISK_SIZE="8"
- echo -e "${DGN}Using ${BGN}2${CL}${DGN}vCPU${CL}"
- CORE_COUNT="2"
- echo -e "${DGN}Using ${BGN}2048${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="2048"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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 ${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}"
- else
- CT_TYPE1="Unprivileged"
- CT_TYPE="1"
- echo -en "${DGN}Set CT Type ${BL}Unprivileged${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: 8 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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;
-}
-
-PVE_CHECK
-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=$BRG,ip=$NET$GATE$VLAN
- -onboot 1
- -cores $CORE_COUNT
- -memory $RAM_SIZE
- -unprivileged $CT_TYPE
- $PW
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: c 226:0 rwm
-lxc.cgroup2.devices.allow: c 226:128 rwm
-lxc.cgroup2.devices.allow: c 29:0 rwm
-lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file
-lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
-lxc.mount.entry: /dev/dri/renderD128 dev/renderD128 none bind,optional,create=file
-EOF
-
-msg_info "Starting LXC Container"
-pct start $CTID
-msg_ok "Started LXC Container"
-
-lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/plex-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 "Plex Media Server should be reachable by going to the following URL.
- ${BL}http://${IP}:32400/web${CL}\n"
diff --git a/ct/plex-v5.sh b/ct/plex-v5.sh
new file mode 100644
index 00000000..a1d4b466
--- /dev/null
+++ b/ct/plex-v5.sh
@@ -0,0 +1,460 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __ __ ___ ___ _____
+ / __ \/ /__ _ __ / |/ /__v5____/ (_)___ _ / ___/___ ______ _____ _____
+ / /_/ / / _ \| |/_/ / /|_/ / _ \/ __ / / __ `/ \__ \/ _ \/ ___/ | / / _ \/ ___/
+ / ____/ / __/> < / / / / __/ /_/ / / /_/ / ___/ / __/ / | |/ / __/ /
+/_/ /_/\___/_/|_| /_/ /_/\___/\__,_/_/\__,_/ /____/\___/_/ |___/\___/_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Plex"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="ubuntu"
+var_version="20.04"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
+ echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
+ CT_TYPE="0"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if var_version=$(whiptail --title "UBUNTU VERSION" --radiolist "Choose Version" 10 58 4 \
+ "18.04" "Bionic" OFF \
+ "20.04" "Focal" ON \
+ "22.04" "Jammy" OFF \
+ "22.10" "Kinetic" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"
+else
+ exit-script
+fi
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" OFF \
+ "0" "Privileged" ON \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+UPD=$(whiptail --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spacebar = Select \nplexupdate info >> https://github.com/mrworf/plexupdate" 10 59 2 \
+ "1" "Update LXC" ON \
+ "2" "Run plexupdate" OFF \
+ 3>&1 1>&2 2>&3)
+
+header_info
+if [ "$UPD" == "1" ]; then
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+exit
+fi
+if [ "$UPD" == "2" ]; then
+bash -c "$(wget -qO - https://raw.githubusercontent.com/mrworf/plexupdate/master/extras/installer.sh)"
+exit
+fi
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/plexmediaserver.list ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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
+if [ "$CT_TYPE" == "0" ]; then
+ LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: c 226:0 rwm
+lxc.cgroup2.devices.allow: c 226:128 rwm
+lxc.cgroup2.devices.allow: c 29:0 rwm
+lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file
+lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
+lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file
+EOF
+fi
+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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:32400/web${CL}\n"
diff --git a/ct/podman-homeassistant-v1.sh b/ct/podman-homeassistant-v1.sh
deleted file mode 100644
index 7bf3164a..00000000
--- a/ct/podman-homeassistant-v1.sh
+++ /dev/null
@@ -1,189 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New Podman Home Assistant Container 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}
- _____ _
- | __ \ | |
- | |__) |__ __| |_ __ ___ __ _ _ __
- | ___/ _ \ / _ | _ _ \ / _ | _ \
- | | | (_) | (_| | | | | | | (_| | | | |
- |_| \___/ \__,_|_| |_| |_|\__,_|_| |_| _ _ _
- | | (_) | | | |
- | |__ ___ _ __ ___ ___ __ _ ___ ___ _ ___| |_ __ _ _ __ | |_
- | _ \ / _ \| _ _ \ / _ \/ _ / __/ __| / __| __/ _ | _ \| __|
- | | | | (_) | | | | | | __/ (_| \__ \__ \ \__ \ || (_| | | | | |_
- |_| |_|\___/|_| |_| |_|\___|\__,_|___/___/_|___/\__\__,_|_| |_|\__|
-
-${CL}"
-}
-header_info
-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 cleanup EXIT
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/podman_ha_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using ${BL}$STORAGE${CL} for storage location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "Container ID is ${BL}$CTID${CL}"
-echo -en "${GN} Updating LXC Template List... "
-pveam update >/dev/null
-echo -e "${CM}${CL} \r"
-
-echo -en "${GN} Downloading LXC Template... "
-OSTYPE=debian
-OSVERSION=${OSTYPE}-11
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-echo -e "${CM}${CL} \r"
-
-echo -en "${GN} Creating LXC Container... "
-DISK_SIZE=16G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
- ARCH=$(dpkg --print-architecture)
-HOSTNAME=p-homeassistant
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 2 -memory 2048 \
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-echo -e "${CM}${CL} \r"
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-pct push $CTID podman_ha_setup.sh /podman_ha_setup.sh -perms 755
-echo -e "${CM}${CL} \r"
-pct exec $CTID /podman_ha_setup.sh
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully Created Podman Home Assistant Container LXC to ${BL}$CTID${CL}."
-echo -e "${CL} Home Assistant Container should be reachable by going to the following URL.
- ${BL}http://${IP}:8123${CL}
-Yacht should be reachable by going to the following URL.
- ${BL}http://${IP}:8000${CL} \n"
diff --git a/ct/podman-homeassistant-v3.sh b/ct/podman-homeassistant-v3.sh
deleted file mode 100644
index 673ec92b..00000000
--- a/ct/podman-homeassistant-v3.sh
+++ /dev/null
@@ -1,366 +0,0 @@
-#!/usr/bin/env bash
-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}"
-CROSS="${RD}✗${CL}"
-APP="P-Home Assistant"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}Privileged${CL}"
- CT_TYPE="0"
- 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}16${CL}${DGN}GB${CL}"
- DISK_SIZE="16"
- echo -e "${DGN}Using ${BGN}2${CL}${DGN}vCPU${CL}"
- CORE_COUNT="2"
- echo -e "${DGN}Using ${BGN}2048${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="2048"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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 ${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}"
- else
- CT_TYPE1="Unprivileged"
- CT_TYPE="1"
- echo -en "${DGN}Set CT Type ${BL}UnPrivileged${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: 16 "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="16"; 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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;
-}
-PVE_CHECK
-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=$BRG,ip=$NET$GATE$VLAN
- -onboot 1
- -cores $CORE_COUNT
- -memory $RAM_SIZE
- -unprivileged $CT_TYPE
- $PW
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-
-msg_info "Starting LXC Container"
-pct start $CTID
-msg_ok "Started LXC Container"
-
-lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/podman-homeassistant-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}:8123${CL}
-Yacht should be reachable by going to the following URL.
- ${BL}http://${IP}:8000${CL}\n"
diff --git a/ct/podman-homeassistant-v5.sh b/ct/podman-homeassistant-v5.sh
new file mode 100644
index 00000000..daba5aec
--- /dev/null
+++ b/ct/podman-homeassistant-v5.sh
@@ -0,0 +1,497 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __
+ / __ \____ ____/ /___ ___ ____ _____
+ / /_/ / __ \/ __ / __ __ \/ __ / __ \
+ / ____/ /_/ / /_/ / / / / / / /_/ / / / /
+ __ __ /_/ \____/\__,_/_/ /_/ /_/\__,_/_/ /_/__ __
+ / / / /___ ____ ___ ___ v5 / | __________(_)____/ /_____ _____ / /_
+ / /_/ / __ \/ __ __ \/ _ \ / /| | / ___/ ___/ / ___/ __/ __ / __ \/ __/
+ / __ / /_/ / / / / / / __/ / ___ |(__ |__ ) (__ ) /_/ /_/ / / / / /_
+/_/ /_/\____/_/ /_/ /_/\___/ /_/ |_/____/____/_/____/\__/\__,_/_/ /_/\__/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Podman-Home Assistant"
+var_disk="16"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+ UPD=$(whiptail --title "UPDATE" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 4 \
+ "1" "Update Podman" ON \
+ "2" "Install HACS" OFF \
+ "3" "Install FileBrowser" OFF \
+ 3>&1 1>&2 2>&3)
+header_info
+if [ "$UPD" == "1" ]; then
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+fi
+if [ "$UPD" == "2" ]; then
+msg_info "Installing Home Assistant Comunity Store (HACS)"
+apt update &>/dev/null
+apt install unzip &>/dev/null
+cd /var/lib/containers/storage/volumes/hass_config/_data
+bash <(curl -fsSL https://get.hacs.xyz) &>/dev/null
+msg_ok "Installed Home Assistant Comunity Store (HACS)"
+echo -e "\n Reboot Home Assistant and clear browser cache then Add HACS integration.\n"
+exit
+fi
+if [ "$UPD" == "3" ]; then
+IP=$(hostname -I | awk '{print $1}')
+msg_info "Installing FileBrowser"
+curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash &>/dev/null
+filebrowser config init -a '0.0.0.0' &>/dev/null
+filebrowser config set -a '0.0.0.0' &>/dev/null
+filebrowser users add admin changeme --perm.admin &>/dev/null
+msg_ok "Installed FileBrowser"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/filebrowser.service"
+echo "[Unit]
+Description=Filebrowser
+After=network-online.target
+[Service]
+User=root
+WorkingDirectory=/root/
+ExecStart=/usr/local/bin/filebrowser -r /
+[Install]
+WantedBy=default.target" >$service_path
+
+systemctl enable --now filebrowser.service &>/dev/null
+msg_ok "Created Service"
+
+msg_ok "Completed Successfully!\n"
+echo -e "FileBrowser should be reachable by going to the following URL.
+ ${BL}http://$IP:8080${CL} admin|changeme\n"
+exit
+fi
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/homeassistant.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -onboot 1
+ -cores $CORE_COUNT
+ -memory $RAM_SIZE
+ -unprivileged $CT_TYPE
+ $PW
+"
+bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
+
+LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+if [ "$CT_TYPE" == "0" ]; then
+ cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: a
+lxc.cap.drop:
+lxc.cgroup2.devices.allow: c 188:* rwm
+lxc.cgroup2.devices.allow: c 189:* rwm
+lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
+lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
+EOF
+else
+ cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: a
+lxc.cap.drop:
+EOF
+fi
+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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8123${CL} \n"
diff --git a/ct/podman-v5.sh b/ct/podman-v5.sh
new file mode 100644
index 00000000..582e0831
--- /dev/null
+++ b/ct/podman-v5.sh
@@ -0,0 +1,425 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __
+ / __ \____v5____/ /___ ___ ____ _____
+ / /_/ / __ \/ __ / __ `__ \/ __ `/ __ \
+ / ____/ /_/ / /_/ / / / / / / /_/ / / / /
+/_/ \____/\__,_/_/ /_/ /_/\__,_/_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Podman"
+var_disk="4"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/containers/registries.conf ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/postgresql-v3.sh b/ct/postgresql-v3.sh
deleted file mode 100644
index 6c26d8b4..00000000
--- a/ct/postgresql-v3.sh
+++ /dev/null
@@ -1,356 +0,0 @@
-#!/usr/bin/env bash
-APP="PostgreSQL"
-var_disk="4"
-var_cpu="1"
-var_ram="1024"
-var_os="debian"
-var_version="11"
-NEXTID=$(pvesh get /cluster/nextid)
-INTEGER='^[0-9]+$'
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-var_install="${NSAPP}-install"
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-BGN=`echo "\033[4;92m"`
-GN=`echo "\033[1;92m"`
-DGN=`echo "\033[32m"`
-CL=`echo "\033[m"`
-BFR="\\r\\033[K"
-HOLD="-"
-CM="${GN}✓${CL}"
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-function msg_info() {
- local msg="$1"
- echo -ne " ${HOLD} ${YW}${msg}..."
-}
-
-function msg_ok() {
- local msg="$1"
- echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
-}
-
-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 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}$var_disk${CL}${DGN}GB${CL}"
- DISK_SIZE="$var_disk"
- echo -e "${DGN}Using ${BGN}$var_cpu${CL}${DGN}vCPU${CL}"
- CORE_COUNT="$var_cpu"
- echo -e "${DGN}Using ${BGN}$var_ram${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="$var_ram"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: $var_disk "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; 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}${DGN}GB${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}${DGN}GB${CL}"
- echo -e "${YW}Allocate CPU cores, or Press [ENTER] for Default: $var_cpu "
- read CORE_COUNT
- if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; fi;
- echo -en "${DGN}Set Cores To ${BL}$CORE_COUNT${CL}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: $var_ram "
- read RAM_SIZE
- if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; fi;
- echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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
-
-export CTID=$CT_ID
-export PCT_OSTYPE=$var_os
-export PCT_OSVERSION=$var_version
-export PCT_DISK_SIZE=$DISK_SIZE
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=$BRG,ip=$NET$GATE$VLAN
- -onboot 1
- -cores $CORE_COUNT
- -memory $RAM_SIZE
- -unprivileged $CT_TYPE
- $PW
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-msg_info "Starting LXC Container"
-pct start $CTID
-msg_ok "Started LXC Container"
-
-lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-msg_ok "Completed Successfully!\n"
-echo -e "Adminer should be reachable by going to the following URL.
- ${BL}http://${IP}/adminer/${CL} \n"
diff --git a/ct/postgresql-v5.sh b/ct/postgresql-v5.sh
new file mode 100644
index 00000000..47a66cf8
--- /dev/null
+++ b/ct/postgresql-v5.sh
@@ -0,0 +1,425 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __ _____ ____ __
+ / __ \____ _____/ /_____ _________ / ___// __ \ / /
+ / /_/ / __ \/ ___/ __/ __ / ___/ _ \\__ \/ / / / / /
+ / ____/ /_/ (__ ) /_/ /_/ / / / __/__/ / /_/ / / /___
+/_/ \____/____/\__/\__, /_/v5 \___/____/\___\_\/_____/
+ /____/
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="PostgreSQL"
+var_disk="4"
+var_cpu="1"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/pgdg.list ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/prometheus-v5.sh b/ct/prometheus-v5.sh
new file mode 100644
index 00000000..34856e1a
--- /dev/null
+++ b/ct/prometheus-v5.sh
@@ -0,0 +1,427 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __ __
+ / __ \_________ ____ ___ ___ / /_/ /_ ___ __ _______
+ / /_/ / ___/ __ \/ __ __ \/ _ \/ __/ __ \/ _ \/ / / / ___/
+ / ____/ / / /_/ / / / / / / __/ /_/ / / / __/ /_/ (__ )
+/_/ v5/_/ \____/_/ /_/ /_/\___/\__/_/ /_/\___/\__,_/____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Prometheus"
+var_disk="4"
+var_cpu="1"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/prometheus.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:9090${CL} \n"
diff --git a/ct/prowlarr-v5.sh b/ct/prowlarr-v5.sh
new file mode 100644
index 00000000..758bf5a3
--- /dev/null
+++ b/ct/prowlarr-v5.sh
@@ -0,0 +1,426 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __
+ / __ \_________ _ __/ /___v5__________
+ / /_/ / ___/ __ \ | /| / / / __ `/ ___/ ___/
+ / ____/ / / /_/ / |/ |/ / / /_/ / / / /
+/_/ /_/ \____/|__/|__/_/\__,_/_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Prowlarr"
+var_disk="4"
+var_cpu="2"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /var/lib/prowlarr/ ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:9696${CL} \n"
diff --git a/ct/qbittorrent-v5.sh b/ct/qbittorrent-v5.sh
new file mode 100644
index 00000000..b52a8f49
--- /dev/null
+++ b/ct/qbittorrent-v5.sh
@@ -0,0 +1,426 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+ ____ _ __ __ __
+ ____ _/ __ )(_) /_/ /_____ _____________v5____ / /_
+ / __ `/ __ / / __/ __/ __ \/ ___/ ___/ _ \/ __ \/ __/
+/ /_/ / /_/ / / /_/ /_/ /_/ / / / / / __/ / / / /_
+\__, /_____/_/\__/\__/\____/_/ /_/ \___/_/ /_/\__/
+ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="qBittorrent"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/qbittorrent-nox.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8090${CL}\n"
diff --git a/ct/radarr-v5.sh b/ct/radarr-v5.sh
new file mode 100644
index 00000000..e9eb9667
--- /dev/null
+++ b/ct/radarr-v5.sh
@@ -0,0 +1,426 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __
+ / __ \____ _____/ /___v5__________
+ / /_/ / __ `/ __ / __ `/ ___/ ___/
+ / _, _/ /_/ / /_/ / /_/ / / / /
+/_/ |_|\__,_/\__,_/\__,_/_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Radarr"
+var_disk="4"
+var_cpu="2"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /var/lib/radarr/ ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:7878${CL} \n"
diff --git a/ct/readarr-v5.sh b/ct/readarr-v5.sh
new file mode 100644
index 00000000..4d555119
--- /dev/null
+++ b/ct/readarr-v5.sh
@@ -0,0 +1,426 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __
+ / __ \___ ____ _____/ /___v5__________
+ / /_/ / _ \/ __ `/ __ / __ `/ ___/ ___/
+ / _, _/ __/ /_/ / /_/ / /_/ / / / /
+/_/ |_|\___/\__,_/\__,_/\__,_/_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Readarr"
+var_disk="4"
+var_cpu="2"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /var/lib/readarr/ ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8787${CL} \n"
diff --git a/ct/rockylinux-v5.sh b/ct/rockylinux-v5.sh
new file mode 100644
index 00000000..e13fcb60
--- /dev/null
+++ b/ct/rockylinux-v5.sh
@@ -0,0 +1,400 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ____ __ __ _
+ / __ \____ _____/ /____ __ / / (_)___v5__ ___ __
+ / /_/ / __ \/ ___/ //_/ / / / / / / / __ \/ / / / |/_/
+ / _, _/ /_/ / /__/ ,< / /_/ / / /___/ / / / / /_/ /> <
+/_/ |_|\____/\___/_/|_|\__, / /_____/_/_/ /_/\__,_/_/|_|
+ /____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Rocky Linux"
+var_disk="1"
+var_cpu="1"
+var_ram="512"
+var_os="rockylinux"
+var_version="9"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}archlinux${CL}"
+ PW="-password rockylinux"
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+ CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3)
+ exitstatus=$?
+ if [ $exitstatus = 0 ]; then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+ fi
+ PW1=$(whiptail --inputbox "Set Root Password (needed for root ssh access)" 8 58 --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
+ exitstatus=$?
+ if [ $exitstatus = 0 ]; then
+ if [ -z $PW1 ]; then
+ PW1="rockylinux" PW="-password $PW1"
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+ else
+ PW="-password $PW1"
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+ fi
+ fi
+ CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
+ exitstatus=$?
+ if [ -z $CT_ID ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ else
+ if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi
+ fi
+ CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
+ exitstatus=$?
+ if [ -z $CT_NAME ]; then
+ HN="$NSAPP"
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+ else
+ if [ $exitstatus = 0 ]; then
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+ fi
+ fi
+ DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
+ exitstatus=$?
+ if [ -z $DISK_SIZE ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ fi
+ CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
+ exitstatus=$?
+ if [ -z $CORE_COUNT ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi
+ fi
+ RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
+ exitstatus=$?
+ if [ -z $RAM_SIZE ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi
+ fi
+ BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
+ exitstatus=$?
+ if [ -z $BRG ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi
+ fi
+ NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
+ exitstatus=$?
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi
+ fi
+ GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
+ exitstatus=$?
+ if [ $exitstatus = 0 ]; then
+ if [ -z $GATE1 ]; then
+ GATE1="Default" GATE=""
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+ else
+ GATE=",gw=$GATE1"
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+ fi
+ fi
+ if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ echo -e "${DGN}Disable IPv6: ${BGN}Yes${CL}"
+ DISABLEIP6="yes"
+ else
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ fi
+ MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
+ exitstatus=$?
+ if [ $exitstatus = 0 ]; then
+ if [ -z $MTU1 ]; then
+ MTU1="Default" MTU=""
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+ else
+ MTU=",mtu=$MTU1"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+ fi
+ fi
+ SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
+ exitstatus=$?
+ if [ $exitstatus = 0 ]; then
+ if [ -z $SD ]; then
+ SD=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+ fi
+ fi
+ NS=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
+ exitstatus=$?
+ if [ $exitstatus = 0 ]; then
+ if [ -z $NS ]; then
+ NS=""
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}Host${CL}"
+ else
+ NX=$NS
+ NS="-nameserver=$NS"
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+ fi
+ fi
+ MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
+ exitstatus=$?
+ if [ $exitstatus = 0 ]; then
+ if [ -z $MAC1 ]; then
+ MAC1="Default" MAC=""
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+ fi
+ VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
+ exitstatus=$?
+ if [ $exitstatus = 0 ]; then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default" VLAN=""
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+ else
+ VLAN=",tag=$VLAN1"
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+ fi
+ fi
+ if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}Yes${CL}"
+ SSH="yes"
+ else
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ fi
+ if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}Yes${CL}"
+ VERB="yes"
+ else
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ fi
+ if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+ else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+dnf -y update
+dnf -y upgrade
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /etc/pacman.d ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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"
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} ${var_version} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/rstptoweb-v5.sh b/ct/rstptoweb-v5.sh
new file mode 100644
index 00000000..803d52c9
--- /dev/null
+++ b/ct/rstptoweb-v5.sh
@@ -0,0 +1,420 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+ ____ _______________ __ _ ____________
+ / __ \/ ___/_ __/ __ \/ /_____| | v5 / / ____/ __ )
+ / /_/ /\__ \ / / / /_/ / __/ __ \ | /| / / __/ / __ |
+ / _, _/___/ // / / ____/ /_/ /_/ / |/ |/ / /___/ /_/ /
+/_/ |_|/____//_/ /_/ \__/\____/|__/|__/_____/_____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="RSTPtoWEB"
+var_disk="4"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} Setup should be reachable by going to the following URL.
+ ${BL}http://${IP}:8083 ${CL} \n"
diff --git a/ct/sabnzbd-v5.sh b/ct/sabnzbd-v5.sh
new file mode 100644
index 00000000..a0f77356
--- /dev/null
+++ b/ct/sabnzbd-v5.sh
@@ -0,0 +1,426 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _____ ___ ____ __ __
+ / ___// | / __ )____v5____ / /_ ____/ /
+ \__ \/ /| | / __ / __ \/_ / / __ \/ __ /
+ ___/ / ___ |/ /_/ / / / / / /_/ /_/ / /_/ /
+/____/_/ |_/_____/_/ /_/ /___/_.___/\__,_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="SABnzbd"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/sabnzbd ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:7777${CL} \n"
diff --git a/ct/scrypted-v5.sh b/ct/scrypted-v5.sh
new file mode 100644
index 00000000..25867b90
--- /dev/null
+++ b/ct/scrypted-v5.sh
@@ -0,0 +1,442 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _____ __ __
+ / ___/____________v5______ / /____ ____/ /
+ \__ \/ ___/ ___/ / / / __ \/ __/ _ \/ __ /
+ ___/ / /__/ / / /_/ / /_/ / /_/ __/ /_/ /
+/____/\___/_/ \__, / .___/\__/\___/\__,_/
+ /____/_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Scrypted"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/scrypted.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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
+if [ "$CT_TYPE" == "0" ]; then
+ LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+ cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: a
+lxc.cap.drop:
+lxc.cgroup2.devices.allow: c 188:* rwm
+lxc.cgroup2.devices.allow: c 189:* rwm
+lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
+lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
+EOF
+fi
+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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}https://${IP}:10443${CL} \n"
diff --git a/ct/shinobi-v5.sh b/ct/shinobi-v5.sh
new file mode 100644
index 00000000..c2c2a019
--- /dev/null
+++ b/ct/shinobi-v5.sh
@@ -0,0 +1,441 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _____ __ _ __ _
+ / ___// /_ (_)___v5____ / /_ (_)
+ \__ \/ __ \/ / __ \/ __ \/ __ \/ /
+ ___/ / / / / / / / / /_/ / /_/ / /
+/____/_/ /_/_/_/ /_/\____/_.___/_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Shinobi"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="ubuntu"
+var_version="22.04"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if var_version=$(whiptail --title "UBUNTU VERSION" --radiolist "Choose Version" 10 58 4 \
+ "18.04" "Bionic" OFF \
+ "20.04" "Focal" OFF \
+ "22.04" "Jammy" ON \
+ "22.10" "Kinetic" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"
+else
+ exit-script
+fi
+
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating Shinobi LXC"
+cd /opt/Shinobi
+sh UPDATE.sh
+pm2 flush
+pm2 restart camera
+pm2 restart cron
+msg_ok "Updated Shinobi LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/Shinobi ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} Setup should be reachable by going to the following URL.
+ ${BL}http://${IP}:8080/super${CL} \n"
diff --git a/ct/sonarr-v5.sh b/ct/sonarr-v5.sh
new file mode 100644
index 00000000..6018fcc2
--- /dev/null
+++ b/ct/sonarr-v5.sh
@@ -0,0 +1,426 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _____
+ / ___/____ ____ ____v5__________
+ \__ \/ __ \/ __ \/ __ `/ ___/ ___/
+ ___/ / /_/ / / / / /_/ / / / /
+/____/\____/_/ /_/\__,_/_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Sonarr"
+var_disk="4"
+var_cpu="2"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/sonarr.list ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8989${CL} \n"
diff --git a/ct/syncthing-v5.sh b/ct/syncthing-v5.sh
new file mode 100644
index 00000000..0f88a88d
--- /dev/null
+++ b/ct/syncthing-v5.sh
@@ -0,0 +1,428 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _____ __ __ _
+ / ___/__ ______v5_____/ /_/ /_ (_)___ ____ _
+ \__ \/ / / / __ \/ ___/ __/ __ \/ / __ \/ __ `/
+ ___/ / /_/ / / / / /__/ /_/ / / / / / / / /_/ /
+/____/\__, /_/ /_/\___/\__/_/ /_/_/_/ /_/\__, /
+ /____/ /____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Syncthing"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/syncthing.list ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8384 ${CL} \n"
diff --git a/ct/tdarr-v5.sh b/ct/tdarr-v5.sh
new file mode 100644
index 00000000..4a879ece
--- /dev/null
+++ b/ct/tdarr-v5.sh
@@ -0,0 +1,426 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ______ __
+ /_ __/___/ /___v5__________
+ / / / __ / __ `/ ___/ ___/
+ / / / /_/ / /_/ / / / /
+/_/ \__,_/\__,_/_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Tdarr"
+var_disk="4"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/tdarr ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8265${CL} \n"
diff --git a/ct/technitiumdns-v2.sh b/ct/technitiumdns-v2.sh
deleted file mode 100644
index 2d960480..00000000
--- a/ct/technitiumdns-v2.sh
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-APP="Technitium DNS"
-HN=$(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}
-
- _______ _ _ _ _
- |__ __| | | (_) | (_)
- | | ___ ___| |__ _ __ _| |_ _ _ _ _ __ ___
- | |/ _ \/ __| _ \| _ \| | __| | | | | _ _ \
- | | __/ (__| | | | | | | | |_| | |_| | | | | | |
- |_|\___|\___|_| |_|_| |_|_|\__|_|\__,_|_| |_| |_|
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=2
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 512
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$HN-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created ${APP} LXC to${CL} ${BL}$CTID${CL}.
-${BL}${APP}${CL} should be reachable by going to the following URL.
- ${BL}http://${IP}:5380${CL} \n"
diff --git a/ct/technitiumdns-v3.sh b/ct/technitiumdns-v3.sh
deleted file mode 100644
index 615cdc64..00000000
--- a/ct/technitiumdns-v3.sh
+++ /dev/null
@@ -1,351 +0,0 @@
-#!/usr/bin/env bash
-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="Technitium DNS"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}2${CL}${DGN}GB${CL}"
- DISK_SIZE="2"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}512${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="512"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 2 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/technitiumdns-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}:5380${CL} \n"
diff --git a/ct/technitiumdns-v5.sh b/ct/technitiumdns-v5.sh
new file mode 100644
index 00000000..44b424f3
--- /dev/null
+++ b/ct/technitiumdns-v5.sh
@@ -0,0 +1,436 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ______ __ _ __ _ ____ _ _______
+ /_ __/__ _____/ /_ ____ (_) /_(_)_ ______ ___ v5 / __ \/ | / / ___/
+ / / / _ \/ ___/ __ \/ __ \/ / __/ / / / / __ __ \ / / / / |/ /\__ \
+ / / / __/ /__/ / / / / / / / /_/ / /_/ / / / / / / / /_/ / /| /___/ /
+/_/ \___/\___/_/ /_/_/ /_/_/\__/_/\__,_/_/ /_/ /_/ /_____/_/ |_//____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Technitium DNS"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP}"
+
+if ! dpkg -s aspnetcore-runtime-7.0 > /dev/null 2>&1; then
+ wget -q https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
+ dpkg -i packages-microsoft-prod.deb
+ apt-get update
+ apt-get install -y aspnetcore-runtime-7.0
+ rm packages-microsoft-prod.deb
+fi
+wget -q https://download.technitium.com/dns/DnsServerPortable.tar.gz
+tar -zxf DnsServerPortable.tar.gz -C /etc/dns/ &>/dev/null
+rm -rf DnsServerPortable.tar.gz
+systemctl restart dns.service
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /etc/dns ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:5380${CL} \n"
diff --git a/ct/transmission-v5.sh b/ct/transmission-v5.sh
new file mode 100644
index 00000000..5fb1e37d
--- /dev/null
+++ b/ct/transmission-v5.sh
@@ -0,0 +1,426 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ______ _ _
+ /_ __/________ _____v5_________ ___ (_)_________(_)___ ____
+ / / / ___/ __ `/ __ \/ ___/ __ `__ \/ / ___/ ___/ / __ \/ __ \
+ / / / / / /_/ / / / (__ ) / / / / / (__ |__ ) / /_/ / / / /
+/_/ /_/ \__,_/_/ /_/____/_/ /_/ /_/_/____/____/_/\____/_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Transmission"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/transmission-daemon/settings.json ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:9091/transmission${CL} \n"
diff --git a/ct/trilium-v5.sh b/ct/trilium-v5.sh
new file mode 100644
index 00000000..3c447d88
--- /dev/null
+++ b/ct/trilium-v5.sh
@@ -0,0 +1,446 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ ______ _ ___
+ /_ __/_v5_(_) (_)_ ______ ___
+ / / / ___/ / / / / / / __ `__ \
+ / / / / / / / / /_/ / / / / / /
+/_/ /_/ /_/_/_/\__,_/_/ /_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Trilium"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+RELEASE=$(curl -s https://api.github.com/repos/zadam/trilium/releases/latest |
+ grep "tag_name" |
+ awk '{print substr($2, 3, length($2)-4) }')
+
+msg_info "Stopping ${APP}"
+systemctl stop trilium.service
+sleep 1
+msg_ok "Stopped ${APP}"
+
+msg_info "Updating to v${RELEASE}"
+wget -q https://github.com/zadam/trilium/releases/download/v$RELEASE/trilium-linux-x64-server-$RELEASE.tar.xz
+tar -xvf trilium-linux-x64-server-$RELEASE.tar.xz &>/dev/null
+cp -r trilium-linux-x64-server/* /opt/trilium/
+msg_ok "Updated to v${RELEASE}"
+
+msg_info "Cleaning up"
+rm -rf trilium-linux-x64-server-$RELEASE.tar.xz trilium-linux-x64-server
+msg_ok "Cleaned"
+
+msg_info "Starting ${APP}"
+systemctl start trilium.service
+sleep 1
+msg_ok "Started ${APP}"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/trilium ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8080${CL} \n"
diff --git a/ct/ubuntu-v1.sh b/ct/ubuntu-v1.sh
deleted file mode 100644
index 3703d85a..00000000
--- a/ct/ubuntu-v1.sh
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/usr/bin/env bash
-
-while true; do
- read -p "This will create a New Ubuntu 21.10 LXC Container. Proceed(y/n)?" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes or no.";;
- esac
-done
-
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
-trap die ERR
-trap cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/ubuntu_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using '$STORAGE' for storage location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "Container ID is $CTID."
-
-echo -e "${CHECKMARK} \e[1;92m Updating LXC Template List... \e[0m"
-pveam update >/dev/null
-echo -e "${CHECKMARK} \e[1;92m Downloading LXC Template... \e[0m"
-OSTYPE=ubuntu
-OSVERSION=${OSTYPE}-21.10
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-
-echo -e "${CHECKMARK} \e[1;92m Creating LXC... \e[0m"
-DISK_SIZE=2G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
-ARCH=$(dpkg --print-architecture)
-HOSTNAME=$OSTYPE
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 1 -memory 512\
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-
-echo -e "${CHECKMARK} \e[1;92m Starting LXC... \e[0m"
-pct start $CTID
-pct push $CTID ubuntu_setup.sh /ubuntu_setup.sh -perms 755
-pct exec $CTID /ubuntu_setup.sh
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully created a Ubuntu LXC Container to $CTID at IP Address ${IP}"
diff --git a/ct/ubuntu-v2.sh b/ct/ubuntu-v2.sh
deleted file mode 100644
index 4152e1d0..00000000
--- a/ct/ubuntu-v2.sh
+++ /dev/null
@@ -1,255 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New Ubuntu 21.10 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}
- _ _ _ _
- | | | | | | |
- | | | | |__ _ _ _ __ | |_ _ _
- | | | | _ \| | | | _ \| __| | | |
- | |__| | |_) | |_| | | | | |_| |_| |
- \____/|_.__/ \__,_|_| |_|\__|\__,_|
-
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=ubuntu
-export PCT_OSVERSION=21.10
-export PCT_DISK_SIZE=2
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname ubuntu
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 512
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/ubuntu-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created Ubuntu 21.10 LXC to${CL} ${BL}$CTID${CL}. \n"
diff --git a/ct/ubuntu-v3.sh b/ct/ubuntu-v3.sh
deleted file mode 100644
index 396abc13..00000000
--- a/ct/ubuntu-v3.sh
+++ /dev/null
@@ -1,372 +0,0 @@
-#!/usr/bin/env bash
-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="Ubuntu"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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 Version ${BGN}22.04${CL}"
- VER="22.04"
- 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}2${CL}${DGN}GB${CL}"
- DISK_SIZE="2"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}512${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="512"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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 18.04, 20.04, 21.10 or Press [ENTER] for Default: 22.04"
- read VER
- if [ -z $VER ]; then VER="22.04"; fi;
- echo -en "${DGN}Set Version To ${BL}$VER${CL}"
-echo -e " ${CM}${CL} \r"
-sleep 1
-clear
-header_info
- echo -e "${RD}Using Advanced Settings${CL}"
- echo -e "${DGN}Using Version ${BGN}$VER${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 Version ${BGN}$VER${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 Version ${BGN}$VER${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 Version ${BGN}$VER${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 Version ${BGN}$VER${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: 2 "
- 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}${DGN}GB${CL}"
-echo -e " ${CM}${CL} \r"
-sleep 1
-clear
-header_info
- echo -e "${RD}Using Advanced Settings${CL}"
- echo -e "${DGN}Using Version ${BGN}$VER${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}${DGN}GB${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}${DGN}vCPU${CL}"
-echo -e " ${CM}${CL} \r"
-sleep 1
-clear
-header_info
- echo -e "${RD}Using Advanced Settings${CL}"
- echo -e "${DGN}Using Version ${BGN}$VER${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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 Version ${BGN}$VER${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${CL}"
-echo -e " ${CM}${CL} \n"
-sleep 1
-clear
-header_info
- echo -e "${RD}Using Advanced Settings${CL}"
- echo -e "${DGN}Using Version ${BGN}$VER${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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 Version ${BGN}$VER${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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 Version ${BGN}$VER${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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 Version ${BGN}$VER${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$VER
-export PCT_DISK_SIZE=$DISK_SIZE
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=$BRG,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/ubuntu-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"
diff --git a/ct/ubuntu-v5.sh b/ct/ubuntu-v5.sh
new file mode 100644
index 00000000..79bcc700
--- /dev/null
+++ b/ct/ubuntu-v5.sh
@@ -0,0 +1,431 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ ____ __
+ / / / / /_v5__ ______ / /___ __
+ / / / / __ \/ / / / __ \/ __/ / / /
+/ /_/ / /_/ / /_/ / / / / /_/ /_/ /
+\____/_.___/\__,_/_/ /_/\__/\__,_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Ubuntu"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="ubuntu"
+var_version="22.04"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}"
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if var_version=$(whiptail --title "UBUNTU VERSION" --radiolist "Choose Version" 10 58 4 \
+ "18.04" "Bionic" OFF \
+ "20.04" "Focal" OFF \
+ "22.04" "Jammy" ON \
+ "22.10" "Kinetic" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"
+else
+ exit-script
+fi
+
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} ${var_version} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/umbrel-v5.sh b/ct/umbrel-v5.sh
new file mode 100644
index 00000000..ee339e2b
--- /dev/null
+++ b/ct/umbrel-v5.sh
@@ -0,0 +1,452 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ __ __ __
+ / / / /___ ___v5/ /_ ________ / /
+ / / / / __ `__ \/ __ \/ ___/ _ \/ /
+/ /_/ / / / / / / /_/ / / / __/ /
+\____/_/ /_/ /_/_.___/_/ \___/_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Umbrel"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}No${CL}"
+ FUSE="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "FUSE OVERLAYFS" --yesno "(ZFS) Enable Fuse Overlayfs?" 10 58); then
+ FUSE="yes"
+else
+ FUSE="no"
+fi
+ echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}$FUSE${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /root/umbrel ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+if [ "$FUSE" == "yes" ]; then
+FEATURES="fuse=1,keyctl=1,nesting=1"
+else
+FEATURES="keyctl=1,nesting=1"
+fi
+TEMP_DIR=$(mktemp -d)
+pushd $TEMP_DIR >/dev/null
+export tz=$timezone
+export ST=$FUSE
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -onboot 1
+ -cores $CORE_COUNT
+ -memory $RAM_SIZE
+ -unprivileged $CT_TYPE
+ $PW
+"
+bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
+LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: a
+lxc.cap.drop:
+EOF
+if [ "$CT_TYPE" == "0" ]; then
+cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: c 188:* rwm
+lxc.cgroup2.devices.allow: c 189:* rwm
+lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
+lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
+EOF
+fi
+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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL (reboot is required before app installs).
+ ${BL}http://${IP} ${CL} \n"
diff --git a/ct/unifi-v2.sh b/ct/unifi-v2.sh
deleted file mode 100644
index 077f3cc1..00000000
--- a/ct/unifi-v2.sh
+++ /dev/null
@@ -1,258 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-APP="UniFi"
-HN=$(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}
- _ _ _ ______ _
- | | | | (_) ____(_)
- | | | |_ __ _| |__ _
- | | | | _ \| | __| | |
- | |__| | | | | | | | |
- \____/|_| |_|_|_| |_|
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=8
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 2
- -memory 2048
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$HN-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created ${APP} LXC to${CL} ${BL}$CTID${CL}.
-${BL}${APP}${CL} should be reachable by going to the following URL.
- ${BL}https://${IP}:8443${CL} \n"
diff --git a/ct/unifi-v3.sh b/ct/unifi-v3.sh
deleted file mode 100644
index 57f7fab8..00000000
--- a/ct/unifi-v3.sh
+++ /dev/null
@@ -1,351 +0,0 @@
-#!/usr/bin/env bash
-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 ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}8${CL}${DGN}GB${CL}"
- DISK_SIZE="8"
- echo -e "${DGN}Using ${BGN}2${CL}${DGN}vCPU${CL}"
- CORE_COUNT="2"
- echo -e "${DGN}Using ${BGN}2048${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="2048"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 8 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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"
diff --git a/ct/unifi-v5.sh b/ct/unifi-v5.sh
new file mode 100644
index 00000000..571c30fb
--- /dev/null
+++ b/ct/unifi-v5.sh
@@ -0,0 +1,427 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ __ _ _____
+ / / / /_v5 (_) __(_)
+ / / / / __ \/ / /_/ /
+/ /_/ / / / / / __/ /
+\____/_/ /_/_/_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Unifi"
+var_disk="8"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP}"
+wget -qL https://get.glennr.nl/unifi/update/unifi-update.sh
+bash unifi-update.sh
+msg_ok "Updated ${APP}"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /usr/lib/unifi ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP}${CL} should be reachable by going to the following URL.
+ ${BL}https://${IP}:8443${CL} \n"
diff --git a/ct/uptimekuma-v2.sh b/ct/uptimekuma-v2.sh
deleted file mode 100644
index b40519ba..00000000
--- a/ct/uptimekuma-v2.sh
+++ /dev/null
@@ -1,261 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-DGN=`echo "\033[32m"`
-CL=`echo "\033[m"`
-APP="Uptime Kuma"
-HN=$(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 "${DGN}
- _ _ _ _ _ __
- | | | | | | (_) | |/ /
- | | | |_ __ | |_ _ _ __ ___ ___ | ' /_ _ _ __ ___ __ _
- | | | | _ \| __| | _ _ \ / _ \ | <| | | | _ _ \ / _ |
- | |__| | |_) | |_| | | | | | | __/ | . \ |_| | | | | | | (_| |
- \____/| .__/ \__|_|_| |_| |_|\___| |_|\_\__,_|_| |_| |_|\__,_|
- | |
- |_|
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=2
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 512
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some applications may not work properly due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$HN-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created ${APP} LXC to${CL} ${BL}$CTID${CL}.
-${BL}${APP}${CL} should be reachable by going to the following URL.
- ${BL}http://${IP}:3001${CL}\n"
diff --git a/ct/uptimekuma-v3.sh b/ct/uptimekuma-v3.sh
deleted file mode 100644
index 0820e29b..00000000
--- a/ct/uptimekuma-v3.sh
+++ /dev/null
@@ -1,353 +0,0 @@
-#!/usr/bin/env bash
-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="Uptime Kuma"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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 "${DGN}
- _ _ _ _ _ __
- | | | | | | (_) | |/ /
- | | | |_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}4${CL}${DGN}GB${CL}"
- DISK_SIZE="4"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}512${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="512"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 4 "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="4"; 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/uptimekuma-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}:3001${CL}\n"
diff --git a/ct/uptimekuma-v5.sh b/ct/uptimekuma-v5.sh
new file mode 100644
index 00000000..09623497
--- /dev/null
+++ b/ct/uptimekuma-v5.sh
@@ -0,0 +1,444 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ __ __ __ _ __ __
+ / / / /___ / /_(_)___ ___ ___ v5 / //_/_ ______ ___ ____ _
+ / / / / __ \/ __/ / __ __ \/ _ \ / ,< / / / / __ __ \/ __ /
+/ /_/ / /_/ / /_/ / / / / / / __/ / /| / /_/ / / / / / / /_/ /
+\____/ .___/\__/_/_/ /_/ /_/\___/ /_/ |_\__,_/_/ /_/ /_/\__,_/
+ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Uptime Kuma"
+var_disk="4"
+var_cpu="1"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+LATEST=$(curl -sL https://api.github.com/repos/louislam/uptime-kuma/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
+msg_info "Stopping ${APP}"
+sudo systemctl stop uptime-kuma &>/dev/null
+msg_ok "Stopped ${APP}"
+
+cd /opt/uptime-kuma
+
+msg_info "Pulling ${APP} ${LATEST}"
+git fetch --all &>/dev/null
+git checkout $LATEST --force &>/dev/null
+msg_ok "Pulled ${APP} ${LATEST}"
+
+msg_info "Updating ${APP} to ${LATEST}"
+npm install --production &>/dev/null
+npm run download-dist &>/dev/null
+msg_ok "Updated ${APP}"
+
+msg_info "Starting ${APP}"
+sudo systemctl start uptime-kuma &>/dev/null
+msg_ok "Started ${APP}"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/uptime-kuma ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:3001${CL} \n"
diff --git a/ct/vaultwarden-v1.sh b/ct/vaultwarden-v1.sh
deleted file mode 100644
index 56b5ac3b..00000000
--- a/ct/vaultwarden-v1.sh
+++ /dev/null
@@ -1,179 +0,0 @@
-#!/usr/bin/env bash
-CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
-RD=`echo "\033[01;31m"`
-BL=`echo "\033[36m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New Vaultwarden LXC Container. 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}
- __ __ _ _ _
- \ \ / / | | | | |
- \ \ / /_ _ _ _| | |___ ____ _ _ __ __| | ___ _ __
- \ \/ / _ | | | | | __\ \ /\ / / _ | __/ _ |/ _ \ _ \
- \ / (_| | |_| | | |_ \ V V / (_| | | | (_| | __/ | | |
- \/ \__,_|\__,_|_|\__| \_/\_/ \__,_|_| \__,_|\___|_| |_|
-
-${CL}"
-}
-
-header_info
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/vault_setup.sh
-
-load_module overlay
-echo -e "${RD} Expect 30+ minute install time. ${CL} \n"
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using '$STORAGE' for storage location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "Container ID is $CTID."
-
-echo -e "${CHECKMARK} \e[1;92m Updating LXC Template List... \e[0m"
-pveam update >/dev/null
-
-echo -e "${CHECKMARK} \e[1;92m Downloading LXC Template... \e[0m"
-OSTYPE=debian
-OSVERSION=${OSTYPE}-11
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-
-echo -e "${CHECKMARK} \e[1;92m Creating LXC Container... \e[0m"
-DISK_SIZE=8G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
-ARCH=$(dpkg --print-architecture)
-HOSTNAME=vaultwarden
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 4 -memory 4096\
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-
-echo -e "${CHECKMARK} \e[1;92m Starting LXC Container... \e[0m"
-pct start $CTID
-pct push $CTID vault_setup.sh /vault_setup.sh -perms 755
-pct exec $CTID /vault_setup.sh
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully created a Vaultwarden LXC Container to $CTID"
-echo -e "\e[1;92m Vaultwarden should be reachable by going to the following URL.
- http://${IP}:8000
-\e[0m"
diff --git a/ct/vaultwarden-v2.sh b/ct/vaultwarden-v2.sh
deleted file mode 100644
index fe16570c..00000000
--- a/ct/vaultwarden-v2.sh
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-APP="Vaultwarden"
-HN=$(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}
- __ __ _ _ _
- \ \ / / | | | | |
- \ \ / /_ _ _ _| | |___ ____ _ _ __ __| | ___ _ __
- \ \/ / _ | | | | | __\ \ /\ / / _ | __/ _ |/ _ \ _ \
- \ / (_| | |_| | | |_ \ V V / (_| | | | (_| | __/ | | |
- \/ \__,_|\__,_|_|\__| \_/\_/ \__,_|_| \__,_|\___|_| |_|
-
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=8
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 4
- -memory 4096
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$HN-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created ${APP} LXC to${CL} ${BL}$CTID${CL}.
-${BL}${APP}${CL} should be reachable by going to the following URL.
- ${BL}http://${IP}:8000${CL} \n"
diff --git a/ct/vaultwarden-v3.sh b/ct/vaultwarden-v3.sh
deleted file mode 100644
index 8295542d..00000000
--- a/ct/vaultwarden-v3.sh
+++ /dev/null
@@ -1,356 +0,0 @@
-#!/usr/bin/env bash
-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="Vaultwarden"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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 / / | | | | |
- \ \ / /_ _ _ _| | |___ ____ _ _ __ __| | ___ _ __
- \ \/ / _ | | | | | __\ \ /\ / / _ | __/ _ |/ _ \ _ \
- \ / (_| | |_| | | |_ \ V V / (_| | | | (_| | __/ | | |
- \/ \__,_|\__,_|_|\__| \_/\_/ \__,_|_| \__,_|\___|_| |_|
-${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}6${CL}${DGN}GB${CL}"
- DISK_SIZE="6"
- echo -e "${DGN}Using ${BGN}4${CL}${DGN}vCPU${CL}"
- CORE_COUNT="4"
- echo -e "${DGN}Using ${BGN}4096${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="4096"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 6 "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="6"; 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}${DGN}GB${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}${DGN}GB${CL}"
- echo -e "${YW}Allocate CPU cores, or Press [ENTER] for Default: 4 "
- read CORE_COUNT
- if [ -z $CORE_COUNT ]; then CORE_COUNT="4"; fi;
- echo -en "${DGN}Set Cores To ${BL}$CORE_COUNT${CL}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: 4096 "
- read RAM_SIZE
- if [ -z $RAM_SIZE ]; then RAM_SIZE="4096"; fi;
- echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/vaultwarden-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-msg_info "Setting Container to Normal Resources"
-pct set $CTID -memory 512
-pct set $CTID -cores 1
-msg_ok "Set Container to Normal Resources"
-
-msg_ok "Completed Successfully!\n"
-echo -e "${APP} should be reachable by going to the following URL.
- ${BL}http://${IP}:8000${CL} \n"
diff --git a/ct/vaultwarden-v5.sh b/ct/vaultwarden-v5.sh
new file mode 100644
index 00000000..bda9fadf
--- /dev/null
+++ b/ct/vaultwarden-v5.sh
@@ -0,0 +1,498 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _ __ ____ _ __ __
+| | / /___ ___v5__/ / /| | / /___ __________/ /__ ____
+| | / / __ `/ / / / / __/ | /| / / __ `/ ___/ __ / _ \/ __ \
+| |/ / /_/ / /_/ / / /_ | |/ |/ / /_/ / / / /_/ / __/ / / /
+|___/\__,_/\__,_/_/\__/ |__/|__/\__,_/_/ \__,_/\___/_/ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Vaultwarden"
+var_disk="6"
+var_cpu="4"
+var_ram="4096"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+VAULT=$(curl -s https://api.github.com/repos/dani-garcia/vaultwarden/releases/latest |
+ grep "tag_name" |
+ awk '{print substr($2, 2, length($2)-3) }')
+WVRELEASE=$(curl -s https://api.github.com/repos/dani-garcia/bw_web_builds/releases/latest |
+ grep "tag_name" |
+ awk '{print substr($2, 2, length($2)-3) }')
+
+UPD=$(whiptail --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 3 \
+ "1" "VaultWarden $VAULT" ON \
+ "2" "Web-Vault $WVRELEASE" OFF \
+ "3" "Show Admin Token" OFF \
+ 3>&1 1>&2 2>&3)
+
+header_info
+if [ "$UPD" == "1" ]; then
+echo -e "\n ⚠️ Ensure you set 2vCPU & 3072MiB RAM MIMIMUM!!! \n"
+msg_info "Stopping Vaultwarden"
+systemctl stop vaultwarden.service
+msg_ok "Stopped Vaultwarden"
+
+msg_info "Updating VaultWarden to $VAULT (Patience)"
+cd ~ && rm -rf vaultwarden
+git clone https://github.com/dani-garcia/vaultwarden &>/dev/null
+cd vaultwarden
+cargo build --features "sqlite,mysql,postgresql" --release &>/dev/null
+DIR=/usr/bin/vaultwarden
+ if [ -d "$DIR" ]; then
+ cp target/release/vaultwarden /usr/bin/
+ else
+ cp target/release/vaultwarden /opt/vaultwarden/bin/
+ fi
+msg_ok "Updated VaultWarden"
+
+msg_info "Cleaning up"
+cd ~ && rm -rf vaultwarden
+msg_ok "Cleaned"
+
+msg_info "Starting Vaultwarden"
+systemctl start vaultwarden.service
+msg_ok "Started Vaultwarden"
+
+msg_ok "$VAULT Update Successful"
+echo -e "\n ⚠️ Ensure you set resources back to normal settings \n"
+exit;
+fi
+if [ "$UPD" == "2" ]; then
+msg_info "Stopping Vaultwarden"
+systemctl stop vaultwarden.service
+msg_ok "Stopped Vaultwarden"
+
+msg_info "Updating Web-Vault to $WVRELEASE"
+curl -fsSLO https://github.com/dani-garcia/bw_web_builds/releases/download/$WVRELEASE/bw_web_$WVRELEASE.tar.gz &>/dev/null
+tar -zxf bw_web_$WVRELEASE.tar.gz -C /opt/vaultwarden/ &>/dev/null
+msg_ok "Updated Web-Vault"
+
+msg_info "Cleaning up"
+rm bw_web_$WVRELEASE.tar.gz
+msg_ok "Cleaned"
+
+msg_info "Starting Vaultwarden"
+systemctl start vaultwarden.service
+msg_ok "Started Vaultwarden"
+msg_ok "$WVRELEASE Update Successful"
+exit;
+fi
+if [ "$UPD" == "3" ]; then
+DIR=/usr/bin/vaultwarden
+ if [ -d "$DIR" ]; then
+ cat /etc/vaultwarden.env | grep "ADMIN_TOKEN"
+ else
+ cat /opt/vaultwarden/.env | grep "ADMIN_TOKEN"
+ fi
+exit
+fi
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/vaultwarden.service ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_info "Setting Container to Normal Resources"
+pct set $CTID -memory 512
+pct set $CTID -cores 1
+msg_ok "Set Container to Normal Resources"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8000${CL} \n"
diff --git a/ct/whisparr-v5.sh b/ct/whisparr-v5.sh
new file mode 100644
index 00000000..21b45677
--- /dev/null
+++ b/ct/whisparr-v5.sh
@@ -0,0 +1,427 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _ ____ _
+| | / / /_ (_)________ ____v5__________
+| | /| / / __ \/ / ___/ __ \/ __ `/ ___/ ___/
+| |/ |/ / / / / (__ ) /_/ / /_/ / / / /
+|__/|__/_/ /_/_/____/ .___/\__,_/_/ /_/
+ /_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Whisparr"
+var_disk="4"
+var_cpu="2"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /var/lib/whisparr ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:6969${CL} \n"
diff --git a/ct/whoogle-v3.sh b/ct/whoogle-v3.sh
deleted file mode 100644
index 01c2c1ca..00000000
--- a/ct/whoogle-v3.sh
+++ /dev/null
@@ -1,355 +0,0 @@
-#!/usr/bin/env bash
-APP="Whoogle"
-var_disk="2"
-var_cpu="1"
-var_ram="512"
-var_os="debian"
-var_version="11"
-NEXTID=$(pvesh get /cluster/nextid)
-INTEGER='^[0-9]+$'
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-var_install="${NSAPP}-install"
-PP=`echo "\e[1;35m"`
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-BGN=`echo "\033[4;92m"`
-GN=`echo "\033[1;92m"`
-DGN=`echo "\033[32m"`
-CL=`echo "\033[m"`
-BFR="\\r\\033[K"
-HOLD="-"
-CM="${GN}✓${CL}"
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-function msg_info() {
- local msg="$1"
- echo -ne " ${HOLD} ${YW}${msg}..."
-}
-
-function msg_ok() {
- local msg="$1"
- echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
-}
-
-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 "${PP}
- __ ___ _ ____ ____ _____ _ ______
- \ \ v3 / / | | |/ __ \ / __ \ / ____| | | ____|
- \ \ /\ / /| |__| | | | | | | | | __| | | |__
- \ \/ \/ / | __ | | | | | | | | |_ | | | __|
- \ /\ / | | | | |__| | |__| | |__| | |____| |____
- \/ \/ |_| |_|\____/ \____/ \_____|______|______|
-${CL}"
-}
-
-header_info
-
-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}$var_disk${CL}${DGN}GB${CL}"
- DISK_SIZE="$var_disk"
- echo -e "${DGN}Using ${BGN}$var_cpu${CL}${DGN}vCPU${CL}"
- CORE_COUNT="$var_cpu"
- echo -e "${DGN}Using ${BGN}$var_ram${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="$var_ram"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: $var_disk "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; 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}${DGN}GB${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}${DGN}GB${CL}"
- echo -e "${YW}Allocate CPU cores, or Press [ENTER] for Default: $var_cpu "
- read CORE_COUNT
- if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; fi;
- echo -en "${DGN}Set Cores To ${BL}$CORE_COUNT${CL}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: $var_ram "
- read RAM_SIZE
- if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; fi;
- echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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
-
-export CTID=$CT_ID
-export PCT_OSTYPE=$var_os
-export PCT_OSVERSION=$var_version
-export PCT_DISK_SIZE=$DISK_SIZE
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=$BRG,ip=$NET$GATE$VLAN
- -onboot 1
- -cores $CORE_COUNT
- -memory $RAM_SIZE
- -unprivileged $CT_TYPE
- $PW
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-msg_info "Starting LXC Container"
-pct start $CTID
-msg_ok "Started LXC Container"
-
-lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$var_install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-msg_ok "Completed Successfully!\n"
-echo -e "${APP} should be reachable by going to the following URL.
- ${BL}http://${IP}:5000${CL} \n"
diff --git a/ct/whoogle-v5.sh b/ct/whoogle-v5.sh
new file mode 100644
index 00000000..ec26eadb
--- /dev/null
+++ b/ct/whoogle-v5.sh
@@ -0,0 +1,426 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _ ____ ______ ____ ________ ______
+| | v5 / / / / / __ \/ __ \/ ____/ / / ____/
+| | /| / / /_/ / / / / / / / / __/ / / __/
+| |/ |/ / __ / /_/ / /_/ / /_/ / /___/ /___
+|__/|__/_/ /_/\____/\____/\____/_____/_____/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Whoogle"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating ${APP} LXC"
+pip3 install whoogle-search --upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /usr/local/bin/whoogle-search ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:5000${CL} \n"
diff --git a/ct/wikijs-v5.sh b/ct/wikijs-v5.sh
new file mode 100644
index 00000000..3848eb4c
--- /dev/null
+++ b/ct/wikijs-v5.sh
@@ -0,0 +1,449 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _ ___ __ _ _
+| | v5 / (_) /__(_) (_)____
+| | /| / / / //_/ / / / ___/
+| |/ |/ / / ,< / / / (__ )
+|__/|__/_/_/|_/_(_)_/ /____/
+ /___/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Wikijs"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Stopping ${APP}"
+systemctl stop wikijs
+msg_ok "Stopped ${APP}"
+
+msg_info "Backing up Data"
+mkdir -p data-backup
+cp -R /opt/wikijs/{db.sqlite,config.yml,/data} ~/data-backup
+msg_ok "Backed up Data"
+
+msg_info "Updating ${APP}"
+rm -rf /opt/wikijs/*
+cd /opt/wikijs
+wget -q https://github.com/Requarks/wiki/releases/latest/download/wiki-js.tar.gz
+tar xzf wiki-js.tar.gz
+msg_ok "Updated ${APP}"
+
+msg_info "Restoring Data"
+cp -R ~/data-backup/* /opt/wikijs
+rm -rf ~/data-backup
+npm rebuild sqlite3 &>/dev/null
+msg_ok "Restored Data"
+
+msg_info "Starting ${APP}"
+systemctl start wikijs
+msg_ok "Started ${APP}"
+msg_ok "Update Successfull"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/wikijs ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:3000${CL} \n"
diff --git a/ct/wireguard-v2.sh b/ct/wireguard-v2.sh
deleted file mode 100644
index 7137c4d3..00000000
--- a/ct/wireguard-v2.sh
+++ /dev/null
@@ -1,253 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New WireGuard 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}
- __ ___ _____ _
- \ \ / (_) / ____| | |
- \ \ /\ / / _ _ __ ___| | __ _ _ __ _ _ __ __| |
- \ \/ \/ / | | __/ _ \ | |_ | | | |/ _ | __/ _ |
- \ /\ / | | | | __/ |__| | |_| | (_| | | | (_| |
- \/ \/ |_|_| \___|\_____|\__,_|\__,_|_| \__,_|
- ${YW}With WGDashboard
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${YW} Privileged ${CL}\n"
- printf " ${YW} 2)${GN} Unprivileged ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=2
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname wireguard
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 1
- -memory 512
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/wireguard-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created WireGuard LXC to${CL} ${BL}$CTID${CL}.
-
-${BL}WGDashboard${CL} should be reachable by going to the following URL.
- ${BL}http://${IP}:10086${CL} \n"
diff --git a/ct/wireguard-v3.sh b/ct/wireguard-v3.sh
deleted file mode 100644
index 528c57ed..00000000
--- a/ct/wireguard-v3.sh
+++ /dev/null
@@ -1,352 +0,0 @@
-#!/usr/bin/env bash
-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="Wireguard"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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|_|_| \___|\_____|\__,_|\__,_|_| \__,_|
- ${YW}With WGDashboard
-${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}2${CL}${DGN}GB${CL}"
- DISK_SIZE="2"
- echo -e "${DGN}Using ${BGN}1${CL}${DGN}vCPU${CL}"
- CORE_COUNT="1"
- echo -e "${DGN}Using ${BGN}512${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="512"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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: 2 "
- 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}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}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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=$BRG,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/wireguard-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 "WGDashboard should be reachable by going to the following URL.
- ${BL}http://${IP}:10086${CL} \n"
diff --git a/ct/wireguard-v5.sh b/ct/wireguard-v5.sh
new file mode 100644
index 00000000..8fce1701
--- /dev/null
+++ b/ct/wireguard-v5.sh
@@ -0,0 +1,479 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _ ___ ______ __
+| | / (_)_______ / ____/_ ______ __________/ /
+| | /| / / / ___/ _ \/ / __/ / / / __ `/ ___/ __ /
+| |/ |/ / / / / __/ /_/ / /_/ / /_/ / / / /_/ /
+|__/|__/_/_/ v5\___/\____/\__,_/\__,_/_/ \__,_/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Wireguard"
+var_disk="2"
+var_cpu="1"
+var_ram="512"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+UPD=$(whiptail --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 2 \
+ "1" "Update ${APP} LXC" ON \
+ "2" "Install WGDashboard" OFF \
+ 3>&1 1>&2 2>&3)
+header_info
+if [ "$UPD" == "1" ]; then
+msg_info "Updating ${APP} LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated ${APP} LXC"
+msg_ok "Update Successfull"
+exit
+fi
+if [ "$UPD" == "2" ]; then
+ if [[ -f /etc/systemd/system/wg-dashboard.service ]]; then
+ msg_error "Existing WGDashboard Installation Found!";
+ exit
+ fi
+IP=$(hostname -I | awk '{print $1}')
+msg_info "Installing Python3-pip"
+apt-get install -y python3-pip &>/dev/null
+pip install flask &>/dev/null
+pip install ifcfg &>/dev/null
+pip install flask_qrcode &>/dev/null
+pip install icmplib &>/dev/null
+msg_ok "Installed Python3-pip"
+
+msg_info "Installing WGDashboard"
+WGDREL=$(curl -s https://api.github.com/repos/donaldzou/WGDashboard/releases/latest |
+ grep "tag_name" |
+ awk '{print substr($2, 2, length($2)-3) }')
+
+git clone -b ${WGDREL} https://github.com/donaldzou/WGDashboard.git /etc/wgdashboard &>/dev/null
+cd /etc/wgdashboard/src
+sudo chmod u+x wgd.sh
+sudo ./wgd.sh install &>/dev/null
+sudo chmod -R 755 /etc/wireguard
+msg_ok "Installed WGDashboard"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/wg-dashboard.service"
+echo "[Unit]
+After=systemd-networkd.service
+
+[Service]
+WorkingDirectory=/etc/wgdashboard/src
+ExecStart=/usr/bin/python3 /etc/wgdashboard/src/dashboard.py
+Restart=always
+
+
+[Install]
+WantedBy=default.target" >$service_path
+chmod 664 /etc/systemd/system/wg-dashboard.service
+systemctl daemon-reload
+systemctl enable wg-dashboard.service &>/dev/null
+systemctl start wg-dashboard.service &>/dev/null
+msg_ok "Created Service"
+echo -e "WGDashboard should be reachable by going to the following URL.
+ ${BL}http://${IP}:10086${CL} admin|admin \n"
+exit
+fi
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /etc/pivpn/wireguard ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/yunohost-v5.sh b/ct/yunohost-v5.sh
new file mode 100644
index 00000000..6d324d78
--- /dev/null
+++ b/ct/yunohost-v5.sh
@@ -0,0 +1,426 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+__ __ __ __ __
+\ \/ /_ ______v5____ / / / /___ _____/ /_
+ \ / / / / __ \/ __ \/ /_/ / __ \/ ___/ __/
+ / / /_/ / / / / /_/ / __ / /_/ (__ ) /_
+/_/\__,_/_/ /_/\____/_/ /_/\____/____/\__/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="YunoHost"
+var_disk="20"
+var_cpu="2"
+var_ram="2048"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}"
+ CT_TYPE="1"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" ON \
+ "0" "Privileged" OFF \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+msg_info "Updating $APP LXC"
+apt-get update &>/dev/null
+apt-get -y upgrade &>/dev/null
+msg_ok "Updated $APP LXC"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/trusted.gpg.d/php.gpg ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}/ ${CL}"
diff --git a/ct/zigbee2mqtt-v1.sh b/ct/zigbee2mqtt-v1.sh
deleted file mode 100644
index 4e7d8c65..00000000
--- a/ct/zigbee2mqtt-v1.sh
+++ /dev/null
@@ -1,173 +0,0 @@
-#!/usr/bin/env bash
-
-while true; do
- read -p "This will create a New Zigbee2MQTT LXC Container. Proceed(y/n)?" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes or no.";;
- esac
-done
-
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
-trap die ERR
-trap cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/zigbee2mqtt_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using '$STORAGE' for storage location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "Container ID is $CTID."
-
-echo -e "${CHECKMARK} \e[1;92m Updating LXC Template List... \e[0m"
-pveam update >/dev/null
-echo -e "${CHECKMARK} \e[1;92m Downloading LXC Template... \e[0m"
-OSTYPE=debian
-OSVERSION=${OSTYPE}-11
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC Template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-
-echo -e "${CHECKMARK} \e[1;92m Creating LXC Container... \e[0m"
-DISK_SIZE=4G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
-ARCH=$(dpkg --print-architecture)
-HOSTNAME=zigbee2mqtt
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 2 -memory 1024 \
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-lxc.cgroup2.devices.allow: c 188:* rwm
-lxc.cgroup2.devices.allow: c 189:* rwm
-lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
-lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
-lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
-EOF
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-
-echo -e "${CHECKMARK} \e[1;92m Starting LXC Container... \e[0m"
-pct start $CTID
-pct push $CTID zigbee2mqtt_setup.sh /zigbee2mqtt_setup.sh -perms 755
-pct exec $CTID /zigbee2mqtt_setup.sh
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully created zigbee2mqtt LXC Container to $CTID at IP Address ${IP}"
-echo
-echo -e "\e[1;31m Updating the configuration.yaml is required and found at /opt/zigbee2mqtt/data/ \e[0m"
-echo
-echo
diff --git a/ct/zigbee2mqtt-v2.sh b/ct/zigbee2mqtt-v2.sh
deleted file mode 100644
index f4a0c0fd..00000000
--- a/ct/zigbee2mqtt-v2.sh
+++ /dev/null
@@ -1,263 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-while true; do
- read -p "This will create a New Zigbee2MQTT 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}
- _______ _ ___ __ __ ____ _______ _______
- |___ (_) | | |__ \| \/ |/ __ \__ __|__ __|
- / / _ __ _| |__ ___ ___ ) | \ / | | | | | | | |
- / / | |/ _ | _ \ / _ \/ _ \ / /| |\/| | | | | | | | |
- / /__| | (_| | |_) | __/ __// /_| | | | |__| | | | | |
- /_____|_|\__, |____/ \___|\___|____|_| |_|\___\_\ |_| |_|
- __/ |
- |___/
-
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${GN} Privileged ${CL}\n"
- printf " ${YW} 2)${RD} Unprivileged (no device passthrough) ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=4
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname zigbee2mqtt
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 2
- -memory 1024
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-lxc.cgroup2.devices.allow: c 188:* rwm
-lxc.cgroup2.devices.allow: c 189:* rwm
-lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
-lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
-lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/zigbee2mqtt-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created Zigbee2MQTT LXC to${CL} ${BL}$CTID${CL}. \n"
diff --git a/ct/zigbee2mqtt-v3.sh b/ct/zigbee2mqtt-v3.sh
deleted file mode 100644
index 8d74ba7f..00000000
--- a/ct/zigbee2mqtt-v3.sh
+++ /dev/null
@@ -1,364 +0,0 @@
-#!/usr/bin/env bash
-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}"
-CROSS="${RD}✗${CL}"
-APP="Zigbee2MQTT"
-NSAPP=$(echo ${APP,,} | tr -d ' ')
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-trap die ERR
-
-function error_exit() {
- trap - ERR
- local reason="Unknown failure occured."
- local msg="${1:-$reason}"
- local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
- echo -e "$flag $msg" 1>&2
- exit $EXIT
-}
-
-while true; do
- read -p "This will 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}Privileged${CL}"
- CT_TYPE="0"
- 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}4${CL}${DGN}GB${CL}"
- DISK_SIZE="4"
- echo -e "${DGN}Using ${BGN}2${CL}${DGN}vCPU${CL}"
- CORE_COUNT="2"
- echo -e "${DGN}Using ${BGN}1024${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="1024"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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 ${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}"
- 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: 4 "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="4"; 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: 1024 "
- read RAM_SIZE
- if [ -z $RAM_SIZE ]; then RAM_SIZE="1024"; fi;
- echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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;
-}
-
-PVE_CHECK
-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=$BRG,ip=$NET$GATE$VLAN
- -onboot 1
- -cores $CORE_COUNT
- -memory $RAM_SIZE
- -unprivileged $CT_TYPE
- $PW
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-lxc.cgroup2.devices.allow: c 188:* rwm
-lxc.cgroup2.devices.allow: c 189:* rwm
-lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
-lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
-lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
-EOF
-
-msg_info "Starting LXC Container"
-pct start $CTID
-msg_ok "Started LXC Container"
-
-lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/zigbee2mqtt-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"
diff --git a/ct/zigbee2mqtt-v5.sh b/ct/zigbee2mqtt-v5.sh
new file mode 100644
index 00000000..f16cc025
--- /dev/null
+++ b/ct/zigbee2mqtt-v5.sh
@@ -0,0 +1,486 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _____ _ __ ___ __ _______ ____________
+/__ / (_)___ _/ /_ ___ ___ |__ \ / |/ / __ \/_ __/_ __/
+ / / / / __ / __ \/ _ \/ _ \__/ // /|_/ / / / / / / / /
+ / /__/ / /_/ / /_/ / __/ __/ __// / / / /_/ / / / / /
+/____/_/\__, /_.___/\___/\___/____/_/ /_/\___\_\/_/ /_/
+ v5 /____/ 🐝
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Zigbee2MQTT"
+var_disk="4"
+var_cpu="2"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
+ CT_TYPE="0"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" OFF \
+ "0" "Privileged" ON \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+cd /opt/zigbee2mqtt
+
+stop_zigbee2mqtt() {
+ if which systemctl 2> /dev/null > /dev/null; then
+ echo "Shutting down Zigbee2MQTT..."
+ sudo systemctl stop zigbee2mqtt
+ else
+ echo "Skipped stopping Zigbee2MQTT, no systemctl found"
+ fi
+}
+
+start_zigbee2mqtt() {
+ if which systemctl 2> /dev/null > /dev/null; then
+ echo "Starting Zigbee2MQTT..."
+ sudo systemctl start zigbee2mqtt
+ else
+ echo "Skipped starting Zigbee2MQTT, no systemctl found"
+ fi
+}
+
+set -e
+
+if [ -d data-backup ]; then
+ echo "ERROR: Backup directory exists. May be previous restoring was failed?"
+ echo "1. Save 'data-backup' and 'data' dirs to safe location to make possibility to restore config later."
+ echo "2. Manually delete 'data-backup' dir and try again."
+ exit 1
+fi
+
+stop_zigbee2mqtt
+
+echo "Generating a backup of the configuration..."
+cp -R data data-backup || { echo "Failed to create backup."; exit 1; }
+
+echo "Initiating update"
+if ! git pull; then
+ echo "Update failed, temporarily storing changes and trying again."
+ git stash && git pull || (echo "Update failed even after storing changes. Aborting."; exit 1)
+fi
+
+echo "Acquiring necessary components..."
+npm ci || { echo "Failed to install necessary components."; exit 1; }
+
+echo "Restoring configuration..."
+cp -R data-backup/* data || { echo "Failed to restore configuration."; exit 1; }
+
+rm -rf data-backup || { echo "Failed to remove backup directory."; exit 1; }
+
+start_zigbee2mqtt
+
+echo "Done!"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/zigbee2mqtt ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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
+if [ "$CT_TYPE" == "0" ]; then
+ LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+ cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: a
+lxc.cap.drop:
+lxc.cgroup2.devices.allow: c 188:* rwm
+lxc.cgroup2.devices.allow: c 189:* rwm
+lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
+lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
+EOF
+fi
+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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
diff --git a/ct/zwave-js-ui-v5.sh b/ct/zwave-js-ui-v5.sh
new file mode 100644
index 00000000..c4f360a6
--- /dev/null
+++ b/ct/zwave-js-ui-v5.sh
@@ -0,0 +1,455 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+function header_info {
+clear
+cat <<"EOF"
+
+ _____ _______ __ ______
+/__ /_ ______ __v5 _____ / / ___/ / / / / _/
+ / /| | /| / / __ `/ | / / _ \ __ / /\__ \ / / / // /
+ / /_| |/ |/ / /_/ /| |/ / __/ / /_/ /___/ / / /_/ // /
+/____/__/|__/\__,_/ |___/\___/ \____//____/ \____/___/
+
+EOF
+}
+header_info
+echo -e "Loading..."
+APP="Zwave-JS-UI"
+var_disk="4"
+var_cpu="2"
+var_ram="1024"
+var_os="debian"
+var_version="11"
+NSAPP=$(echo ${APP,,} | tr -d ' ')
+var_install="${NSAPP}-v5-install"
+timezone=$(cat /etc/timezone)
+INTEGER='^[0-9]+([.][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}"
+CROSS="${RD}✗${CL}"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+function PVE_CHECK() {
+if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
+ echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
+ echo -e "Requires PVE Version 7.0 or higher"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+function ARCH_CHECK() {
+if [ "$(dpkg --print-architecture)" != "amd64" ]; then
+ echo -e "\n ${CROSS} This script will not work with PiMox! \n"
+ echo -e "Exiting..."
+ sleep 2
+exit
+fi
+}
+
+function default_settings() {
+ echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}"
+ CT_TYPE="0"
+ echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
+ PW=""
+ echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
+ CT_ID=$NEXTID
+ echo -e "${DGN}Using Hostname: ${BGN}$NSAPP${CL}"
+ HN=$NSAPP
+ echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
+ BRG="vmbr0"
+ echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
+ NET=dhcp
+ echo -e "${DGN}Using Gateway Address: ${BGN}Default${CL}"
+ GATE=""
+ echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
+ DISABLEIP6="no"
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
+ MTU=""
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
+ SD=""
+ echo -e "${DGN}Using DNS Server Address: ${BGN}Host${CL}"
+ NS=""
+ echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
+ MAC=""
+ echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
+ VLAN=""
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+ SSH="no"
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
+ VERB="no"
+ echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
+}
+
+function exit-script() {
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+}
+
+function advanced_settings() {
+if CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
+ "1" "Unprivileged" OFF \
+ "0" "Privileged" ON \
+ 3>&1 1>&2 2>&3); then
+ echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
+else
+ exit-script
+fi
+
+if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
+ if [ -z $PW1 ]; then
+ PW1="Automatic Login"
+ PW=" "
+ else
+ PW="-password $PW1"
+ fi
+ echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
+else
+ exit-script
+fi
+
+if CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_ID" ]; then
+ CT_ID="$NEXTID"
+ echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+ else
+ echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
+ fi
+else
+ exit
+fi
+
+if CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3); then
+ if [ -z "$CT_NAME" ]; then
+ HN="$NSAPP"
+ else
+ HN=$(echo ${CT_NAME,,} | tr -d ' ')
+ fi
+ echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+else
+ exit-script
+fi
+
+if DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z "$DISK_SIZE" ]; then
+ DISK_SIZE="$var_disk"
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ else
+ if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
+ echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
+ advanced_settings
+ fi
+ echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
+ if [ -z "$CORE_COUNT" ]; then
+ CORE_COUNT="$var_cpu"
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ else
+ echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+ fi
+else
+ exit-script
+fi
+
+if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
+ if [ -z "$RAM_SIZE" ]; then
+ RAM_SIZE="$var_ram"
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ else
+ echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+ fi
+else
+ exit-script
+fi
+
+if BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
+ if [ -z "$BRG" ]; then
+ BRG="vmbr0"
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ else
+ echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+ fi
+else
+ exit-script
+fi
+
+if NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $NET ]; then
+ NET="dhcp"
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ else
+ echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+ fi
+else
+ exit-script
+fi
+if GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58 --title "GATEWAY IP" 3>&1 1>&2 2>&3); then
+ if [ -z $GATE1 ]; then
+ GATE1="Default"
+ GATE=""
+ else
+ GATE=",gw=$GATE1"
+ fi
+ echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
+ DISABLEIP6="yes"
+else
+ DISABLEIP6="no"
+fi
+ echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
+
+if MTU1=$(whiptail --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
+ if [ -z $MTU1 ]; then
+ MTU1="Default"
+ MTU=""
+ else
+ MTU=",mtu=$MTU1"
+ fi
+ echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
+else
+ exit-script
+fi
+
+if SD=$(whiptail --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
+ if [ -z $SD ]; then
+ SX=Host
+ SD=""
+ else
+ SX=$SD
+ SD="-searchdomain=$SD"
+ fi
+ echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
+else
+ exit-script
+fi
+
+if NX=$(whiptail --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
+ if [ -z $NX ]; then
+ NX=Host
+ NS=""
+ else
+ NS="-nameserver=$NX"
+ fi
+ echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
+else
+ exit-script
+fi
+
+if MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
+ if [ -z $MAC1 ]; then
+ MAC1="Default"
+ MAC=""
+ else
+ MAC=",hwaddr=$MAC1"
+ echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
+ fi
+else
+ exit-script
+fi
+
+if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
+ if [ -z $VLAN1 ]; then
+ VLAN1="Default"
+ VLAN=""
+ else
+ VLAN=",tag=$VLAN1"
+ fi
+ echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
+else
+ exit-script
+fi
+
+if (whiptail --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
+ SSH="yes"
+else
+ SSH="no"
+fi
+ echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
+
+if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
+ VERB="yes"
+else
+ VERB="no"
+fi
+ echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
+
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+ echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
+else
+ clear
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+fi
+}
+
+function install_script() {
+ARCH_CHECK
+PVE_CHECK
+NEXTID=$(pvesh get /cluster/nextid)
+header_info
+ if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
+ header_info
+ echo -e "${BL}Using Default Settings${CL}"
+ default_settings
+ else
+ header_info
+ echo -e "${RD}Using Advanced Settings${CL}"
+ advanced_settings
+ fi
+}
+
+function update_script() {
+header_info
+RELEASE=$(curl -s https://api.github.com/repos/zwave-js/zwave-js-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
+msg_info "Stopping Z-wave JS UI"
+systemctl stop zwave-js-ui.service
+msg_ok "Stopped Z-wave JS UI"
+
+msg_info "Updating Z-wave JS UI"
+wget https://github.com/zwave-js/zwave-js-ui/releases/download/${RELEASE}/zwave-js-ui-${RELEASE}-linux.zip &>/dev/null
+unzip zwave-js-ui-${RELEASE}-linux.zip &>/dev/null
+\cp -R zwave-js-ui-linux /opt/zwave-js-ui
+msg_ok "Updated Z-wave JS UI"
+
+msg_info "Starting Z-wave JS UI"
+systemctl enable --now zwave-js-ui.service
+msg_ok "Started Z-wave JS UI"
+
+msg_info "Cleanup"
+rm -rf zwave-js-ui-${RELEASE}-linux.zip zwave-js-ui-linux store
+msg_ok "Cleaned"
+msg_ok "Updated Successfully!\n"
+exit
+}
+
+if command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ install_script
+fi
+
+if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/zwave-js-ui ]]; then
+ msg_error "No ${APP} Installation Found!"
+ exit
+fi
+
+if ! command -v pveversion >/dev/null 2>&1; then
+ if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then
+ clear
+ echo -e "⚠ User exited script \n"
+ exit
+ fi
+ update_script
+fi
+
+if [ "$VERB" == "yes" ]; then set -x; fi
+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 tz=$timezone
+export DISABLEIPV6=$DISABLEIP6
+export APPLICATION=$APP
+export VERBOSE=$VERB
+export SSH_ROOT=${SSH}
+export CTID=$CT_ID
+export PCT_OSTYPE=$var_os
+export PCT_OSVERSION=$var_version
+export PCT_DISK_SIZE=$DISK_SIZE
+export PCT_OPTIONS="
+ -features $FEATURES
+ -hostname $HN
+ $SD
+ $NS
+ -net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
+ -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
+if [ "$CT_TYPE" == "0" ]; then
+ LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+ cat <>$LXC_CONFIG
+lxc.cgroup2.devices.allow: a
+lxc.cap.drop:
+lxc.cgroup2.devices.allow: c 188:* rwm
+lxc.cgroup2.devices.allow: c 189:* rwm
+lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
+lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
+lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
+EOF
+fi
+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/install/$var_install.sh)" || exit
+IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
+pct set $CTID -description "# ${APP} LXC
+### https://tteck.github.io/Proxmox/
+
"
+msg_ok "Completed Successfully!\n"
+echo -e "${APP} should be reachable by going to the following URL.
+ ${BL}http://${IP}:8091${CL} \n"
diff --git a/ct/zwavejs2mqtt-v1.sh b/ct/zwavejs2mqtt-v1.sh
deleted file mode 100644
index fb21a900..00000000
--- a/ct/zwavejs2mqtt-v1.sh
+++ /dev/null
@@ -1,191 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-
-while true; do
- read -p "This will create a New Zwavejs2MQTT LXC Container. 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}
- ______ _ ___ __ __ ____ _______ _______
- |___ / (_) |__ \| \/ |/ __ \__ __|__ __|
- / /_ ____ ___ _____ _ ___ ) | \ / | | | | | | | |
- / /\ \ /\ / / _ \ \ / / _ \ / __| / /| |\/| | | | | | | | |
- / /__\ V V / (_| |\ V / __/ \__ \/ /_| | | | |__| | | | | |
- /_____|\_/\_/ \__,_| \_/ \___| |___/____|_| |_|\___\_\ |_| |_|
- _/ |
- |__/
-${CL}"
-}
-
-header_info
-
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
-CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
-trap die ERR
-trap cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if [ ! -z ${MOUNT+x} ]; then
- pct unmount $CTID
- fi
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
-function load_module() {
- if ! $(lsmod | grep -Fq $1); then
- modprobe $1 &>/dev/null || \
- die "Failed to load '$1' module."
- fi
- MODULES_PATH=/etc/modules
- if ! $(grep -Fxq "$1" $MODULES_PATH); then
- echo "$1" >> $MODULES_PATH || \
- die "Failed to add '$1' module to load at boot."
- fi
-}
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-wget -qL https://raw.githubusercontent.com/tteck/Proxmox/main/setup/zwavejs2mqtt_setup.sh
-
-load_module overlay
-
-while read -r line; do
- TAG=$(echo $line | awk '{print $1}')
- TYPE=$(echo $line | awk '{printf "%-10s", $2}')
- FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
- ITEM=" Type: $TYPE Free: $FREE "
- OFFSET=2
- if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
- MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
- fi
- STORAGE_MENU+=( "$TAG" "$ITEM" "OFF" )
-done < <(pvesm status -content rootdir | awk 'NR>1')
-if [ $((${#STORAGE_MENU[@]}/3)) -eq 0 ]; then
- warn "'Container' needs to be selected for at least one storage location."
- die "Unable to detect valid storage location."
-elif [ $((${#STORAGE_MENU[@]}/3)) -eq 1 ]; then
- STORAGE=${STORAGE_MENU[0]}
-else
- while [ -z "${STORAGE:+x}" ]; do
- STORAGE=$(whiptail --title "Storage Pools" --radiolist \
- "Which storage pool you would like to use for the container?\n\n" \
- 16 $(($MSG_MAX_LENGTH + 23)) 6 \
- "${STORAGE_MENU[@]}" 3>&1 1>&2 2>&3) || exit
- done
-fi
-info "Using '$STORAGE' for Storage Location."
-
-CTID=$(pvesh get /cluster/nextid)
-info "Container ID is $CTID."
-
-echo -e "${CHECKMARK} \e[1;92m Updating LXC Template List... \e[0m"
-pveam update >/dev/null
-echo -e "${CHECKMARK} \e[1;92m Downloading LXC Template... \e[0m"
-OSTYPE=debian
-OSVERSION=${OSTYPE}-11
-mapfile -t TEMPLATES < <(pveam available -section system | sed -n "s/.*\($OSVERSION.*\)/\1/p" | sort -t - -k 2 -V)
-TEMPLATE="${TEMPLATES[-1]}"
-pveam download local $TEMPLATE >/dev/null ||
- die "A problem occured while downloading the LXC template."
-
-STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
-case $STORAGE_TYPE in
- dir|nfs)
- DISK_EXT=".raw"
- DISK_REF="$CTID/"
- ;;
- zfspool)
- DISK_PREFIX="subvol"
- DISK_FORMAT="subvol"
- ;;
-esac
-DISK=${DISK_PREFIX:-vm}-${CTID}-disk-0${DISK_EXT-}
-ROOTFS=${STORAGE}:${DISK_REF-}${DISK}
-
-echo -e "${CHECKMARK} \e[1;92m Creating LXC Container... \e[0m"
-DISK_SIZE=4G
-pvesm alloc $STORAGE $CTID $DISK $DISK_SIZE --format ${DISK_FORMAT:-raw} >/dev/null
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some containers may not work properly due to ZFS not supporting 'fallocate'."
-else
- mkfs.ext4 $(pvesm path $ROOTFS) &>/dev/null
-fi
-ARCH=$(dpkg --print-architecture)
-HOSTNAME=zwavejs2mqtt
-TEMPLATE_STRING="local:vztmpl/${TEMPLATE}"
-pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
- -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 2 -memory 1024\
- -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-lxc.cgroup2.devices.allow: c 188:* rwm
-lxc.cgroup2.devices.allow: c 189:* rwm
-lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
-lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
-lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
-lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
-EOF
-
-MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
-ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
-pct unmount $CTID && unset MOUNT
-
-echo -e "${CHECKMARK} \e[1;92m Starting LXC Container... \e[0m"
-pct start $CTID
-pct push $CTID zwavejs2mqtt_setup.sh /zwavejs2mqtt_setup.sh -perms 755
-pct exec $CTID /zwavejs2mqtt_setup.sh
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-info "Successfully created a Zwavejs2MQTT LXC Container to $CTID at IP Address ${IP}:8091"
diff --git a/ct/zwavejs2mqtt-v2.sh b/ct/zwavejs2mqtt-v2.sh
deleted file mode 100644
index 72669df9..00000000
--- a/ct/zwavejs2mqtt-v2.sh
+++ /dev/null
@@ -1,266 +0,0 @@
-#!/usr/bin/env bash
-YW=`echo "\033[33m"`
-BL=`echo "\033[36m"`
-RD=`echo "\033[01;31m"`
-CM='\xE2\x9C\x94\033'
-GN=`echo "\033[1;92m"`
-CL=`echo "\033[m"`
-APP="Zwavejs2MQTT"
-HN=$(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}
- ______ _ ___ __ __ ____ _______ _______
- |___ / (_) |__ \| \/ |/ __ \__ __|__ __|
- / /_ ____ ___ _____ _ ___ ) | \ / | | | | | | | |
- / /\ \ /\ / / _ \ \ / / _ \ / __| / /| |\/| | | | | | | | |
- / /__\ V V / (_| |\ V / __/ \__ \/ /_| | | | |__| | | | | |
- /_____|\_/\_/ \__,_| \_/ \___| |___/____|_| |_|\___\_\ |_| |_|
- _/ |
- |__/
-${CL}"
-}
-
-header_info
-show_menu(){
- printf " ${YW} 1)${GN} Privileged ${CL}\n"
- printf " ${YW} 2)${RD} Unprivileged (no device passthrough) ${CL}\n"
-
- printf "Please choose a Install Method and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message1=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
-}
-show_menu
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Privileged Install";
- IM=0
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Unprivileged Install";
- IM=1
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Install Method from the menu";
- show_menu;
- ;;
- esac
- done
-show_menu2(){
- printf " ${YW} 1)${GN} Use Automatic Login ${CL}\n"
- printf " ${YW} 2)${GN} Use Password (changeme) ${CL}\n"
-
- printf "Please choose a Password Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message2=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
-}
-show_menu2
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic Login";
- PW=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Password (changeme)";
- PW="-password changeme"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a Password Type from the menu";
- show_menu2;
- ;;
- esac
- done
-show_menu3(){
- printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
- printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
-
- printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
- read opt
-}
-
-option_picked(){
- message3=${@:-"${CL}Error: No message passed"}
- printf " ${YW}${message1}${CL}\n"
- printf " ${YW}${message2}${CL}\n"
- printf " ${YW}${message3}${CL}\n"
-}
-show_menu3
-while [ "$opt" != " " ]
- do
- case $opt in
- 1) clear;
- header_info;
- option_picked "Using Automatic DHCP";
- DHCP=" "
- break;
- ;;
- 2) clear;
- header_info;
- option_picked "Using Manual DHCP";
- DHCP="1"
- break;
- ;;
-
- x)exit;
- ;;
- \n)exit;
- ;;
- *)clear;
- option_picked "Please choose a DHCP Type from the menu";
- show_menu3;
- ;;
- esac
- done
-
-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 cleanup EXIT
-
-function error_exit() {
- trap - ERR
- local DEFAULT='Unknown failure occured.'
- local REASON="\e[97m${1:-$DEFAULT}\e[39m"
- local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
- msg "$FLAG $REASON"
- [ ! -z ${CTID-} ] && cleanup_ctid
- exit $EXIT
-}
-function warn() {
- local REASON="\e[97m$1\e[39m"
- local FLAG="\e[93m[WARNING]\e[39m"
- msg "$FLAG $REASON"
-}
-function info() {
- local REASON="$1"
- local FLAG="\e[36m[INFO]\e[39m"
- msg "$FLAG $REASON"
-}
-function msg() {
- local TEXT="$1"
- echo -e "$TEXT"
-}
-function cleanup_ctid() {
- if $(pct status $CTID &>/dev/null); then
- if [ "$(pct status $CTID | awk '{print $2}')" == "running" ]; then
- pct stop $CTID
- fi
- pct destroy $CTID
- elif [ "$(pvesm list $STORAGE --vmid $CTID)" != "" ]; then
- pvesm free $ROOTFS
- fi
-}
-function cleanup() {
- popd >/dev/null
- rm -rf $TEMP_DIR
-}
- if [ "$IM" == "1" ]; then
- FEATURES="nesting=1,keyctl=1"
- else
- FEATURES="nesting=1"
- fi
-
-TEMP_DIR=$(mktemp -d)
-pushd $TEMP_DIR >/dev/null
-
-export CTID=$(pvesh get /cluster/nextid)
-export PCT_OSTYPE=debian
-export PCT_OSVERSION=11
-export PCT_DISK_SIZE=4
-export PCT_OPTIONS="
- -features $FEATURES
- -hostname $HN
- -net0 name=eth0,bridge=vmbr0,ip=dhcp
- -onboot 1
- -cores 2
- -memory 1024
- -unprivileged ${IM}
- ${PW}
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F ":" '{print $2}') | awk 'NR>1 {print $2}')
-if [ "$STORAGE_TYPE" == "zfspool" ]; then
- warn "Some addons may not work due to ZFS not supporting 'fallocate'."
-fi
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-lxc.cgroup2.devices.allow: c 188:* rwm
-lxc.cgroup2.devices.allow: c 189:* rwm
-lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
-lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
-lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
-lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
-EOF
-if [ "$DHCP" == "1" ]; then
-MAC=$(pct config $CTID \
-| grep -i hwaddr \
-| awk '{print substr($2, 31, length($3) 17 ) }') \
-
-echo -e "MAC Address ${BL}$MAC${CL}"
-
-dhcp_reservation(){
- printf "Please set DHCP reservation and press Enter."
- read
-}
-dhcp_reservation
-fi
-
-echo -en "${GN} Starting LXC Container... "
-pct start $CTID
-echo -e "${CM}${CL} \r"
-
-alias lxc-cmd="lxc-attach -n $CTID --"
-
-lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/$HN-install.sh)" || exit
-
-IP=$(pct exec $CTID ip a s dev eth0 | sed -n '/inet / s/\// /p' | awk '{print $2}')
-
-echo -e "${GN}Successfully created ${APP} LXC to${CL} ${BL}$CTID${CL}.
-${BL}${APP}${CL} should be reachable by going to the following URL.
- ${BL}http://${IP}:8091${CL} \n"
diff --git a/ct/zwavejs2mqtt-v3.sh b/ct/zwavejs2mqtt-v3.sh
deleted file mode 100644
index 7e3e8107..00000000
--- a/ct/zwavejs2mqtt-v3.sh
+++ /dev/null
@@ -1,349 +0,0 @@
-#!/usr/bin/env bash
-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}"
-CROSS="${RD}✗${CL}"
-APP="Zwavejs2MQTT"
-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}
- ______ _ ___ __ __ ____ _______ _______
- |___ / (_) |__ \| \/ |/ __ \__ __|__ __|
- / /_ ____ ___ _____ _ ___ ) | \ / | | | | | | | |
- / /\ \ /\ / / _ \ \ / / _ \ / __| / /| |\/| | | | | | | | |
- / /__\ V V / (_| |\ V / __/ \__ \/ /_| | | | |__| | | | | |
- /_____|\_/\_/ \__,_| \_/ \___| |___/____|_| |_|\___\_\ |_| 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}Privileged${CL}"
- CT_TYPE="0"
- 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}4${CL}${DGN}GB${CL}"
- DISK_SIZE="4"
- echo -e "${DGN}Using ${BGN}2${CL}${DGN}vCPU${CL}"
- CORE_COUNT="2"
- echo -e "${DGN}Using ${BGN}1024${CL}${DGN}MiB RAM${CL}"
- RAM_SIZE="1024"
- echo -e "${DGN}Using Bridge ${BGN}vmbr0${CL}"
- BRG="vmbr0"
- echo -e "${DGN}Using Static IP Address ${BGN}DHCP${CL}"
- NET=dhcp
- echo -e "${DGN}Using Gateway Address ${BGN}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 ${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}"
- 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: 4 "
- read DISK_SIZE
- if [ -z $DISK_SIZE ]; then DISK_SIZE="4"; 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}${DGN}GB${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}${DGN}GB${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}${DGN}vCPU${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${YW}Allocate RAM in MiB, or Press [ENTER] for Default: 1024 "
- read RAM_SIZE
- if [ -z $RAM_SIZE ]; then RAM_SIZE="1024"; fi;
- echo -en "${DGN}Set RAM To ${BL}$RAM_SIZE${CL}${DGN}MiB RAM${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${YW}Enter a Bridge, or Press [ENTER] for Default: vmbr0 "
- read BRG
- if [ -z $BRG ]; then BRG="vmbr0"; fi;
- echo -en "${DGN}Set Bridge To ${BL}$BRG${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${YW}Enter a Static IPv4 CIDR 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${CL}"
- echo -e "${DGN}Using Static IP Address ${BGN}$NET${CL}"
- echo -e "${YW}Enter a Gateway IP (mandatory if static IP is used), 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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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}${DGN}GB${CL}"
- echo -e "${DGN}Using ${BGN}${CORE_COUNT}${CL}${DGN}vCPU${CL}"
- echo -e "${DGN}Using ${BGN}${RAM_SIZE}${CL}${DGN}MiB RAM${CL}"
- echo -e "${DGN}Using Bridge ${BGN}${BRG}${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;
-}
-
-PVE_CHECK
-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=$BRG,ip=$NET$GATE$VLAN
- -onboot 1
- -cores $CORE_COUNT
- -memory $RAM_SIZE
- -unprivileged $CT_TYPE
- $PW
-"
-bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
-
-LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
-cat <> $LXC_CONFIG
-lxc.cgroup2.devices.allow: a
-lxc.cap.drop:
-lxc.cgroup2.devices.allow: c 188:* rwm
-lxc.cgroup2.devices.allow: c 189:* rwm
-lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
-lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
-lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
-lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
-EOF
-
-msg_info "Starting LXC Container"
-pct start $CTID
-msg_ok "Started LXC Container"
-
-lxc-attach -n $CTID -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/zwavejs2mqtt-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}:8091${CL} \n"
diff --git a/install/adguard-v5-install.sh b/install/adguard-v5-install.sh
new file mode 100644
index 00000000..4f8ae86e
--- /dev/null
+++ b/install/adguard-v5-install.sh
@@ -0,0 +1,125 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing AdGuard Home"
+systemctl stop systemd-resolved
+echo "DNSStubListener=no" >>/etc/systemd/resolved.conf
+ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
+wget -qL https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh
+$STD bash install.sh
+rm install.sh
+msg_ok "Installed AdGuard Home"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/alpine-vaultwarden-v5-install.sh b/install/alpine-vaultwarden-v5-install.sh
new file mode 100644
index 00000000..92e668b4
--- /dev/null
+++ b/install/alpine-vaultwarden-v5-install.sh
@@ -0,0 +1,119 @@
+#!/bin/sh
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then
+$STD sysctl net.ipv6.conf.all.disable_ipv6=1
+$STD sysctl net.ipv6.conf.default.disable_ipv6=1
+echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.d/99-sysctl.conf
+echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.d/99-sysctl.conf
+$STD sysctl -p /etc/sysctl.d/99-sysctl.conf
+fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+i=$RETRY_NUM
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+while [ $i -gt 0 ]; do
+ if [ "$(ip addr show | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d'/' -f1)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+ i=$((i-1))
+done
+
+if [ "$(ip addr show | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d'/' -f1)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(ip addr show | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1 | tail -n1)${CL}"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if echo "$prompt" | grep -Ei "^(y|yes)$" > /dev/null; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apk update
+$STD apk upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apk add bash
+$STD apk add curl
+$STD apk add openssl
+$STD apk add openssh
+$STD apk add nano
+$STD apk add mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Vaultwarden"
+$STD apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing vaultwarden
+cat </etc/conf.d/vaultwarden
+export DATA_FOLDER=/var/lib/vaultwarden
+export WEB_VAULT_ENABLED=true
+export ADMIN_TOKEN=$(openssl rand -base64 48)
+export ROCKET_ADDRESS=0.0.0.0
+EOF
+$STD rc-service vaultwarden start
+$STD rc-update add vaultwarden default
+msg_ok "Installed Vaultwarden"
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+if [[ "${SSH_ROOT}" == "yes" ]]; then
+ $STD rc-update add sshd
+ $STD /etc/init.d/sshd start
+fi
diff --git a/install/audiobookshelf-v5-install.sh b/install/audiobookshelf-v5-install.sh
new file mode 100644
index 00000000..f32761b2
--- /dev/null
+++ b/install/audiobookshelf-v5-install.sh
@@ -0,0 +1,123 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y gnupg
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing audiobookshelf"
+$STD apt-key add <(curl -s --compressed "https://advplyr.github.io/audiobookshelf-ppa/KEY.gpg")
+sh -c 'echo "deb https://advplyr.github.io/audiobookshelf-ppa ./" > /etc/apt/sources.list.d/audiobookshelf.list'
+$STD apt-get update
+$STD apt install audiobookshelf
+msg_ok "Installed audiobookshelf"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/autobrr-v5-install.sh b/install/autobrr-v5-install.sh
new file mode 100644
index 00000000..61a9c8c2
--- /dev/null
+++ b/install/autobrr-v5-install.sh
@@ -0,0 +1,144 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Autobrr"
+wget -q $(curl -s https://api.github.com/repos/autobrr/autobrr/releases/latest | grep download | grep linux_x86_64 | cut -d\" -f4)
+tar -C /usr/local/bin -xzf autobrr*.tar.gz
+rm -rf autobrr*.tar.gz
+mkdir -p /root/.config/autobrr
+cat <>/root/.config/autobrr/config.toml
+# https://autobrr.com/configuration/autobrr
+host = "0.0.0.0"
+port = 7474
+logLevel = "DEBUG"
+sessionSecret = "$(openssl rand -base64 24)"
+EOF
+msg_ok "Installed Autobrr"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/autobrr.service"
+echo "[Unit]
+Description=autobrr service
+After=syslog.target network-online.target
+[Service]
+Type=simple
+User=root
+Group=root
+ExecStart=/usr/local/bin/autobrr --config=/root/.config/autobrr/
+[Install]
+WantedBy=multi-user.target" >$service_path
+systemctl enable --now -q autobrr.service
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/blocky-v5-install.sh b/install/blocky-v5-install.sh
new file mode 100644
index 00000000..aa1722b0
--- /dev/null
+++ b/install/blocky-v5-install.sh
@@ -0,0 +1,377 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Blocky"
+systemctl stop systemd-resolved
+$STD systemctl disable systemd-resolved.service
+RELEASE=$(curl -s https://api.github.com/repos/0xERR0R/blocky/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
+wget -q https://github.com/0xERR0R/blocky/releases/download/v$RELEASE/blocky_${RELEASE}_Linux_x86_64.tar.gz
+mkdir -p /opt/blocky
+tar -xf blocky_${RELEASE}_Linux_x86_64.tar.gz -C /opt/blocky
+rm -rf blocky_${RELEASE}_Linux_x86_64.tar.gz
+cat </opt/blocky/config.yml
+upstream:
+ # these external DNS resolvers will be used. Blocky picks 2 random resolvers from the list for each query
+ # format for resolver: [net:]host:[port][/path]. net could be empty (default, shortcut for tcp+udp), tcp+udp, tcp, udp, tcp-tls or https (DoH). If port is empty, default port will be used (53 for udp and tcp, 853 for tcp-tls, 443 for https (Doh))
+ # this configuration is mandatory, please define at least one external DNS resolver
+ default:
+ # example for tcp+udp IPv4 server (https://digitalcourage.de/)
+ #- 5.9.164.112
+ # Cloudflare
+ - 1.1.1.1
+ # example for DNS-over-TLS server (DoT)
+ #- tcp-tls:fdns1.dismail.de:853
+ # example for DNS-over-HTTPS (DoH)
+ #- https://dns.digitale-gesellschaft.ch/dns-query
+ # optional: use client name (with wildcard support: * - sequence of any characters, [0-9] - range)
+ # or single ip address / client subnet as CIDR notation
+ #laptop*:
+ #- 123.123.123.123
+
+# optional: timeout to query the upstream resolver. Default: 2s
+#upstreamTimeout: 2s
+
+# optional: If true, blocky will fail to start unless at least one upstream server per group is reachable. Default: false
+#startVerifyUpstream: true
+
+# optional: Determines how blocky will create outgoing connections. This impacts both upstreams, and lists.
+# accepted: dual, v4, v6
+# default: dual
+#connectIPVersion: dual
+
+# optional: custom IP address(es) for domain name (with all sub-domains). Multiple addresses must be separated by a comma
+# example: query "printer.lan" or "my.printer.lan" will return 192.168.178.3
+#customDNS:
+ #customTTL: 1h
+ # optional: if true (default), return empty result for unmapped query types (for example TXT, MX or AAAA if only IPv4 address is defined).
+ # if false, queries with unmapped types will be forwarded to the upstream resolver
+ #filterUnmappedTypes: true
+ # optional: replace domain in the query with other domain before resolver lookup in the mapping
+ #rewrite:
+ #example.com: printer.lan
+ #mapping:
+ #printer.lan: 192.168.178.3,2001:0db8:85a3:08d3:1319:8a2e:0370:7344
+
+# optional: definition, which DNS resolver(s) should be used for queries to the domain (with all sub-domains). Multiple resolvers must be separated by a comma
+# Example: Query client.fritz.box will ask DNS server 192.168.178.1. This is necessary for local network, to resolve clients by host name
+#conditional:
+ # optional: if false (default), return empty result if after rewrite, the mapped resolver returned an empty answer. If true, the original query will be sent to the upstream resolver
+ # Example: The query "blog.example.com" will be rewritten to "blog.fritz.box" and also redirected to the resolver at 192.168.178.1. If not found and if was set to , the original query "blog.example.com" will be sent upstream.
+ # Usage: One usecase when having split DNS for internal and external (internet facing) users, but not all subdomains are listed in the internal domain.
+ #fallbackUpstream: false
+ # optional: replace domain in the query with other domain before resolver lookup in the mapping
+ #rewrite:
+ #example.com: fritz.box
+ #mapping:
+ #fritz.box: 192.168.178.1
+ #lan.net: 192.168.178.1,192.168.178.2
+
+# optional: use black and white lists to block queries (for example ads, trackers, adult pages etc.)
+blocking:
+ # definition of blacklist groups. Can be external link (http/https) or local file
+ blackLists:
+ ads:
+ - https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
+ - https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
+ - http://sysctl.org/cameleon/hosts
+ - https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
+ - |
+ # inline definition with YAML literal block scalar style
+ # hosts format
+ someadsdomain.com
+ special:
+ - https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews/hosts
+ # definition of whitelist groups. Attention: if the same group has black and whitelists, whitelists will be used to disable particular blacklist entries. If a group has only whitelist entries -> this means only domains from this list are allowed, all other domains will be blocked
+ whiteLists:
+ ads:
+ - whitelist.txt
+ - |
+ # inline definition with YAML literal block scalar style
+ # hosts format
+ whitelistdomain.com
+ # this is a regex
+ /^banners?[_.-]/
+ # definition: which groups should be applied for which client
+ clientGroupsBlock:
+ # default will be used, if no special definition for a client name exists
+ default:
+ - ads
+ - special
+ # use client name (with wildcard support: * - sequence of any characters, [0-9] - range)
+ # or single ip address / client subnet as CIDR notation
+ #laptop*:
+ #- ads
+ #192.168.178.1/24:
+ #- special
+ # which response will be sent, if query is blocked:
+ # zeroIp: 0.0.0.0 will be returned (default)
+ # nxDomain: return NXDOMAIN as return code
+ # comma separated list of destination IP addresses (for example: 192.100.100.15, 2001:0db8:85a3:08d3:1319:8a2e:0370:7344). Should contain ipv4 and ipv6 to cover all query types. Useful with running web server on this address to display the "blocked" page.
+ blockType: zeroIp
+ # optional: TTL for answers to blocked domains
+ # default: 6h
+ blockTTL: 1m
+ # optional: automatically list refresh period (in duration format). Default: 4h.
+ # Negative value -> deactivate automatically refresh.
+ # 0 value -> use default
+ refreshPeriod: 4h
+ # optional: timeout for list download (each url). Default: 60s. Use large values for big lists or slow internet connections
+ downloadTimeout: 4m
+ # optional: Download attempt timeout. Default: 60s
+ downloadAttempts: 5
+ # optional: Time between the download attempts. Default: 1s
+ downloadCooldown: 10s
+ # optional: if failOnError, application startup will fail if at least one list can't be downloaded / opened. Default: blocking
+ #startStrategy: failOnError
+
+# optional: configuration for caching of DNS responses
+caching:
+ # duration how long a response must be cached (min value).
+ # If <=0, use response's TTL, if >0 use this value, if TTL is smaller
+ # Default: 0
+ minTime: 5m
+ # duration how long a response must be cached (max value).
+ # If <0, do not cache responses
+ # If 0, use TTL
+ # If > 0, use this value, if TTL is greater
+ # Default: 0
+ maxTime: 30m
+ # Max number of cache entries (responses) to be kept in cache (soft limit). Useful on systems with limited amount of RAM.
+ # Default (0): unlimited
+ maxItemsCount: 0
+ # if true, will preload DNS results for often used queries (default: names queried more than 5 times in a 2-hour time window)
+ # this improves the response time for often used queries, but significantly increases external traffic
+ # default: false
+ prefetching: true
+ # prefetch track time window (in duration format)
+ # default: 120
+ prefetchExpires: 2h
+ # name queries threshold for prefetch
+ # default: 5
+ prefetchThreshold: 5
+ # Max number of domains to be kept in cache for prefetching (soft limit). Useful on systems with limited amount of RAM.
+ # Default (0): unlimited
+ #prefetchMaxItemsCount: 0
+
+# optional: configuration of client name resolution
+clientLookup:
+ # optional: this DNS resolver will be used to perform reverse DNS lookup (typically local router)
+ #upstream: 192.168.178.1
+ # optional: some routers return multiple names for client (host name and user defined name). Define which single name should be used.
+ # Example: take second name if present, if not take first name
+ #singleNameOrder:
+ #- 2
+ #- 1
+ # optional: custom mapping of client name to IP addresses. Useful if reverse DNS does not work properly or just to have custom client names.
+ #clients:
+ #laptop:
+ #- 192.168.178.29
+# optional: configuration for prometheus metrics endpoint
+prometheus:
+ # enabled if true
+ #enable: true
+ # url path, optional (default '/metrics')
+ #path: /metrics
+
+# optional: write query information (question, answer, client, duration etc.) to daily csv file
+queryLog:
+ # optional one of: mysql, postgresql, csv, csv-client. If empty, log to console
+ #type: mysql
+ # directory (should be mounted as volume in docker) for csv, db connection string for mysql/postgresql
+ #target: db_user:db_password@tcp(db_host_or_ip:3306)/db_name?charset=utf8mb4&parseTime=True&loc=Local
+ #postgresql target: postgres://user:password@db_host_or_ip:5432/db_name
+ # if > 0, deletes log files which are older than ... days
+ #logRetentionDays: 7
+ # optional: Max attempts to create specific query log writer, default: 3
+ #creationAttempts: 1
+ # optional: Time between the creation attempts, default: 2s
+ #creationCooldown: 2s
+
+# optional: Blocky can synchronize its cache and blocking state between multiple instances through redis.
+redis:
+ # Server address and port
+ #address: redis:6379
+ # Password if necessary
+ #password: passwd
+ # Database, default: 0
+ #database: 2
+ # Connection is required for blocky to start. Default: false
+ #required: true
+ # Max connection attempts, default: 3
+ #connectionAttempts: 10
+ # Time between the connection attempts, default: 1s
+ #connectionCooldown: 3s
+
+# optional: DNS listener port(s) and bind ip address(es), default 53 (UDP and TCP). Example: 53, :53, "127.0.0.1:5353,[::1]:5353"
+port: 553
+# optional: Port(s) and bind ip address(es) for DoT (DNS-over-TLS) listener. Example: 853, 127.0.0.1:853
+#tlsPort: 853
+# optional: HTTPS listener port(s) and bind ip address(es), default empty = no http listener. If > 0, will be used for prometheus metrics, pprof, REST API, DoH... Example: 443, :443, 127.0.0.1:443
+#httpPort: 4000
+#httpsPort: 443
+# optional: Mininal TLS version that the DoH and DoT server will use
+#minTlsServeVersion: 1.3
+# if https port > 0: path to cert and key file for SSL encryption. if not set, self-signed certificate will be generated
+#certFile: server.crt
+#keyFile: server.key
+# optional: use this DNS server to resolve blacklist urls and upstream DNS servers. Useful if no DNS resolver is configured and blocky needs to resolve a host name. Format net:IP:port, net must be udp or tcp
+#bootstrapDns: tcp+udp:1.1.1.1
+
+filtering:
+# optional: drop all queries with following query types. Default: empty
+ #queryTypes:
+ #- AAAA
+
+# optional: if path defined, use this file for query resolution (A, AAAA and rDNS). Default: empty
+hostsFile:
+ # optional: Path to hosts file (e.g. /etc/hosts on Linux)
+ #filePath: /etc/hosts
+ # optional: TTL, default: 1h
+ #hostsTTL: 60m
+ # optional: Time between hosts file refresh, default: 1h
+ #refreshPeriod: 30m
+ # optional: Whether loopback hosts addresses (127.0.0.0/8 and ::1) should be filtered or not, default: false
+ #filterLoopback: true
+# optional: Log level (one from debug, info, warn, error). Default: info
+#logLevel: info
+# optional: Log format (text or json). Default: text
+#logFormat: text
+# optional: log timestamps. Default: true
+#logTimestamp: true
+# optional: obfuscate log output (replace all alphanumeric characters with *) for user sensitive data like request domains or responses to increase privacy. Default: false
+#logPrivacy: false
+
+# optional: add EDE error codes to dns response
+#ede:
+ # enabled if true, Default: false
+ #enable: true
+EOF
+msg_ok "Installed Blocky"
+
+msg_info "Creating Service"
+cat </etc/systemd/system/blocky.service
+[Unit]
+Description=Blocky
+After=network.target
+[Service]
+User=root
+WorkingDirectory=/opt/blocky
+ExecStart=/opt/blocky/./blocky --config config.yml
+[Install]
+WantedBy=multi-user.target
+EOF
+$STD systemctl enable --now blocky
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/casaos-v5-install.sh b/install/casaos-v5-install.sh
new file mode 100644
index 00000000..22f05ba7
--- /dev/null
+++ b/install/casaos-v5-install.sh
@@ -0,0 +1,133 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y unzip
+msg_ok "Installed Dependencies"
+
+msg_info "Installing CasaOS (Patience)"
+DOCKER_CONFIG_PATH='/etc/docker/daemon.json'
+mkdir -p $(dirname $DOCKER_CONFIG_PATH)
+if [ "$ST" == "yes" ]; then
+VER=$(curl -s https://api.github.com/repos/containers/fuse-overlayfs/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
+cd /usr/local/bin
+curl -sSL -o fuse-overlayfs https://github.com/containers/fuse-overlayfs/releases/download/$VER/fuse-overlayfs-x86_64
+chmod 755 /usr/local/bin/fuse-overlayfs
+cd ~
+echo -e '{\n "storage-driver": "fuse-overlayfs",\n "log-driver": "journald"\n}' > /etc/docker/daemon.json
+else
+echo -e '{\n "log-driver": "journald"\n}' > /etc/docker/daemon.json
+fi
+$STD bash <(curl -fsSL https://get.casaos.io)
+msg_ok "Installed CasaOS"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/changedetection-v5-install.sh b/install/changedetection-v5-install.sh
new file mode 100644
index 00000000..433ee0f9
--- /dev/null
+++ b/install/changedetection-v5-install.sh
@@ -0,0 +1,137 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y pip
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Change Detection"
+mkdir /opt/changedetection
+$STD pip3 install changedetection.io
+$STD python3 -m pip install dnspython==2.2.1
+msg_ok "Installed Change Detection"
+
+msg_info "Creating Service"
+cat </etc/systemd/system/changedetection.service
+[Unit]
+Description=Change Detection
+After=network-online.target
+[Service]
+Type=simple
+WorkingDirectory=/opt/changedetection
+ExecStart=changedetection.io -d /opt/changedetection -p 5000
+[Install]
+WantedBy=multi-user.target
+EOF
+$STD systemctl enable --now changedetection
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/cronicle-v5-install.sh b/install/cronicle-v5-install.sh
new file mode 100644
index 00000000..d9addbf6
--- /dev/null
+++ b/install/cronicle-v5-install.sh
@@ -0,0 +1,143 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y git
+$STD apt-get install -y make
+$STD apt-get install -y g++
+$STD apt-get install -y gcc
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up Node.js Repository"
+$STD bash <(curl -fsSL https://deb.nodesource.com/setup_16.x)
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+$STD apt-get install -y nodejs
+msg_ok "Installed Node.js"
+
+msg_info "Installing Cronicle Primary Server"
+LATEST=$(curl -sL https://api.github.com/repos/jhuckaby/Cronicle/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
+IP=$(hostname -I | awk '{print $1}')
+mkdir -p /opt/cronicle
+cd /opt/cronicle
+$STD tar zxvf <(curl -fsSL https://github.com/jhuckaby/Cronicle/archive/${LATEST}.tar.gz) --strip-components 1
+$STD npm install
+$STD node bin/build.js dist
+sed -i "s/localhost:3012/${IP}:3012/g" /opt/cronicle/conf/config.json
+if [[ $SERV == "y" ]]; then $STD /opt/cronicle/bin/control.sh setup; fi
+$STD /opt/cronicle/bin/control.sh start
+$STD cp /opt/cronicle/bin/cronicled.init /etc/init.d/cronicled
+chmod 775 /etc/init.d/cronicled
+$STD update-rc.d cronicled defaults
+msg_ok "Installed Cronicle Primary Server"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/daemonsync-v5-install.sh b/install/daemonsync-v5-install.sh
new file mode 100644
index 00000000..abe4dec6
--- /dev/null
+++ b/install/daemonsync-v5-install.sh
@@ -0,0 +1,123 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y g++-multilib
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Daemon Sync Server"
+wget -qL https://github.com/tteck/Proxmox/raw/main/misc/daemonsync_2.2.0.0059_amd64.deb
+$STD dpkg -i daemonsync_2.2.0.0059_amd64.deb
+msg_ok "Installed Daemon Sync Server"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+rm -rf daemonsync_2.2.0.0059_amd64.deb
+$STD apt-get autoremove >/dev/null
+$STD apt-get autoclean >/dev/null
+msg_ok "Cleaned"
diff --git a/install/dashy-v5-install.sh b/install/dashy-v5-install.sh
new file mode 100644
index 00000000..1bd8e71d
--- /dev/null
+++ b/install/dashy-v5-install.sh
@@ -0,0 +1,153 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y git
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up Node.js Repository"
+$STD bash <(curl -fsSL https://deb.nodesource.com/setup_16.x)
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+$STD apt-get install -y nodejs git make g++ gcc
+msg_ok "Installed Node.js"
+
+msg_info "Installing Yarn"
+$STD npm install --global yarn
+msg_ok "Installed Yarn"
+
+msg_info "Installing Dashy (Patience)"
+$STD git clone https://github.com/Lissy93/dashy.git
+cd /dashy
+$STD yarn
+export NODE_OPTIONS=--max-old-space-size=1000
+$STD yarn build
+msg_ok "Installed Dashy"
+
+msg_info "Creating Service"
+cat </etc/systemd/system/dashy.service
+[Unit]
+Description=dashy
+
+[Service]
+Type=simple
+WorkingDirectory=/dashy
+ExecStart=/usr/bin/yarn start
+[Install]
+WantedBy=multi-user.target
+EOF
+$STD systemctl enable dashy
+systemctl start dashy
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/debian-v5-install.sh b/install/debian-v5-install.sh
new file mode 100644
index 00000000..ef9e1a6f
--- /dev/null
+++ b/install/debian-v5-install.sh
@@ -0,0 +1,115 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/deconz-v5-install.sh b/install/deconz-v5-install.sh
new file mode 100644
index 00000000..ad060379
--- /dev/null
+++ b/install/deconz-v5-install.sh
@@ -0,0 +1,146 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y gnupg
+msg_ok "Installed Dependencies"
+
+msg_info "Setting Phoscon Repository"
+$STD apt-key add <(curl -fsSL http://phoscon.de/apt/deconz.pub.key)
+sh -c "echo 'deb [arch=amd64] http://phoscon.de/apt/deconz $(lsb_release -cs) main' > /etc/apt/sources.list.d/deconz.list"
+msg_ok "Setup Phoscon Repository"
+
+msg_info "Installing deConz"
+$STD apt-get update
+$STD apt-get install -y deconz
+msg_ok "Installed deConz"
+
+msg_info "Creating Service"
+service_path="/lib/systemd/system/deconz.service"
+echo "[Unit]
+Description=deCONZ: ZigBee gateway -- REST API
+Wants=deconz-init.service deconz-update.service
+StartLimitIntervalSec=0
+
+[Service]
+User=root
+ExecStart=/usr/bin/deCONZ -platform minimal --http-port=80
+Restart=on-failure
+RestartSec=30
+AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_KILL CAP_SYS_BOOT CAP_SYS_TIME
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+$STD systemctl enable --now deconz
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/deluge-v5-install.sh b/install/deluge-v5-install.sh
new file mode 100644
index 00000000..dbc85972
--- /dev/null
+++ b/install/deluge-v5-install.sh
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Python3-pip"
+$STD apt-get install -y python3-pip
+msg_ok "Installed Python3-pip"
+
+msg_info "Installing Deluge"
+$STD pip install deluge[all]
+$STD pip install lbry-libtorrent
+msg_ok "Installed Deluge"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/deluged.service"
+echo "[Unit]
+Description=Deluge Bittorrent Client Daemon
+Documentation=man:deluged
+After=network-online.target
+
+[Service]
+Type=simple
+UMask=007
+ExecStart=/usr/local/bin/deluged -d
+Restart=on-failure
+TimeoutStopSec=300
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+
+service_path="/etc/systemd/system/deluge-web.service"
+echo "[Unit]
+Description=Deluge Bittorrent Client Web Interface
+Documentation=man:deluge-web
+After=deluged.service
+Wants=deluged.service
+
+[Service]
+Type=simple
+UMask=027
+ExecStart=/usr/local/bin/deluge-web -d
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+systemctl enable --now -q deluged.service
+systemctl enable --now -q deluge-web.service
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/devuan-v5-install.sh b/install/devuan-v5-install.sh
new file mode 100644
index 00000000..a8ca650d
--- /dev/null
+++ b/install/devuan-v5-install.sh
@@ -0,0 +1,98 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/docker-v5-install.sh b/install/docker-v5-install.sh
new file mode 100644
index 00000000..83339fb5
--- /dev/null
+++ b/install/docker-v5-install.sh
@@ -0,0 +1,165 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+get_latest_release() {
+ curl -sL https://api.github.com/repos/$1/releases/latest | grep '"tag_name":' | cut -d'"' -f4
+}
+
+DOCKER_LATEST_VERSION=$(get_latest_release "moby/moby")
+PORTAINER_LATEST_VERSION=$(get_latest_release "portainer/portainer")
+DOCKER_COMPOSE_LATEST_VERSION=$(get_latest_release "docker/compose")
+
+msg_info "Installing Docker $DOCKER_LATEST_VERSION"
+DOCKER_CONFIG_PATH='/etc/docker/daemon.json'
+mkdir -p $(dirname $DOCKER_CONFIG_PATH)
+if [ "$ST" == "yes" ]; then
+VER=$(curl -s https://api.github.com/repos/containers/fuse-overlayfs/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
+cd /usr/local/bin
+curl -sSL -o fuse-overlayfs https://github.com/containers/fuse-overlayfs/releases/download/$VER/fuse-overlayfs-x86_64
+chmod 755 /usr/local/bin/fuse-overlayfs
+cd ~
+echo -e '{\n "storage-driver": "fuse-overlayfs",\n "log-driver": "journald"\n}' > /etc/docker/daemon.json
+else
+echo -e '{\n "log-driver": "journald"\n}' > /etc/docker/daemon.json
+fi
+$STD sh <(curl -sSL https://get.docker.com)
+msg_ok "Installed Docker $DOCKER_LATEST_VERSION"
+
+read -r -p "Would you like to add Portainer? " prompt
+if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ msg_info "Installing Portainer $PORTAINER_LATEST_VERSION"
+ docker volume create portainer_data >/dev/null
+ $STD docker run -d \
+ -p 8000:8000 \
+ -p 9000:9000 \
+ --name=portainer \
+ --restart=always \
+ -v /var/run/docker.sock:/var/run/docker.sock \
+ -v portainer_data:/data \
+ portainer/portainer-ce:latest
+ msg_ok "Installed Portainer $PORTAINER_LATEST_VERSION"
+fi
+
+read -r -p "Would you like to add Docker Compose? " prompt
+if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ msg_info "Installing Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"
+ DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
+ mkdir -p $DOCKER_CONFIG/cli-plugins
+ curl -sSL https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_LATEST_VERSION/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
+ chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
+ msg_ok "Installed Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"
+fi
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/emby-v5-install.sh b/install/emby-v5-install.sh
new file mode 100644
index 00000000..0a41c2c5
--- /dev/null
+++ b/install/emby-v5-install.sh
@@ -0,0 +1,140 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+if [[ -z "$(grep -w "100000" /proc/self/uid_map)" ]]; then
+ msg_info "Setting Up Hardware Acceleration"
+ $STD apt-get -y install \
+ va-driver-all \
+ ocl-icd-libopencl1
+ if [[ ${PCT_OSVERSION} == "20.04" ]]; then
+ $STD apt-get install -y beignet-opencl-icd
+ else
+ $STD apt-get install -y intel-opencl-icd
+ fi
+ /bin/chgrp video /dev/dri
+ /bin/chmod 755 /dev/dri
+ /bin/chmod 660 /dev/dri/*
+ msg_ok "Set Up Hardware Acceleration"
+fi
+
+LATEST=$(curl -sL https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
+
+msg_info "Installing Emby"
+wget -q https://github.com/MediaBrowser/Emby.Releases/releases/download/${LATEST}/emby-server-deb_${LATEST}_amd64.deb
+$STD dpkg -i emby-server-deb_${LATEST}_amd64.deb
+msg_ok "Installed Emby"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+rm emby-server-deb_${LATEST}_amd64.deb
+msg_ok "Cleaned"
diff --git a/install/emqx-v5-install.sh b/install/emqx-v5-install.sh
new file mode 100644
index 00000000..853a3cdb
--- /dev/null
+++ b/install/emqx-v5-install.sh
@@ -0,0 +1,121 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing EMQX"
+$STD bash <(curl -fsSL https://packagecloud.io/install/repositories/emqx/emqx/script.deb.sh)
+$STD apt-get install -y emqx
+$STD systemctl enable --now emqx
+msg_ok "Installed EMQX"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+apt-get autoremove >/dev/null
+apt-get autoclean >/dev/null
+msg_ok "Cleaned"
diff --git a/install/esphome-v5-install.sh b/install/esphome-v5-install.sh
new file mode 100644
index 00000000..7bd8b99f
--- /dev/null
+++ b/install/esphome-v5-install.sh
@@ -0,0 +1,142 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y git
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Python3-pip"
+$STD apt-get install -y python3-pip
+msg_ok "Installed Python3-pip"
+
+msg_info "Installing ESPHome"
+$STD pip3 install esphome
+msg_ok "Installed ESPHome"
+
+msg_info "Installing ESPHome Dashboard"
+$STD pip3 install tornado esptool
+
+service_path="/etc/systemd/system/esphomeDashboard.service"
+echo "[Unit]
+Description=ESPHome Dashboard
+After=network.target
+[Service]
+ExecStart=/usr/local/bin/esphome /root/config/ dashboard
+Restart=always
+User=root
+[Install]
+WantedBy=multi-user.target" >$service_path
+$STD systemctl enable esphomeDashboard.service
+systemctl start esphomeDashboard
+msg_ok "Installed ESPHome Dashboard"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/go2rtc-v5-install.sh b/install/go2rtc-v5-install.sh
new file mode 100644
index 00000000..57577695
--- /dev/null
+++ b/install/go2rtc-v5-install.sh
@@ -0,0 +1,138 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing go2rtc"
+mkdir -p /opt/go2rtc
+cd /opt/go2rtc
+wget -q https://github.com/AlexxIT/go2rtc/releases/latest/download/go2rtc_linux_amd64
+chmod +x go2rtc_linux_amd64
+msg_ok "Installed go2rtc"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/go2rtc.service"
+echo "[Unit]
+Description=go2rtc service
+After=network.target
+
+[Service]
+Type=simple
+User=root
+ExecStart=/opt/go2rtc/go2rtc_linux_amd64
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+systemctl enable -q --now go2rtc
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/grafana-v5-install.sh b/install/grafana-v5-install.sh
new file mode 100644
index 00000000..9b327c23
--- /dev/null
+++ b/install/grafana-v5-install.sh
@@ -0,0 +1,131 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y gnupg
+$STD apt-get install -y apt-transport-https
+$STD apt-get install -y software-properties-common
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up Grafana Repository"
+wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key
+sh -c 'echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" > /etc/apt/sources.list.d/grafana.list'
+msg_ok "Set up Grafana Repository"
+
+msg_info "Installing Grafana"
+$STD apt-get update
+$STD apt-get install -y grafana
+msg_ok "Installed Grafana"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+systemctl start grafana-server
+$STD systemctl enable grafana-server.service
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/grocy-v5-install.sh b/install/grocy-v5-install.sh
new file mode 100644
index 00000000..f5bf1469
--- /dev/null
+++ b/install/grocy-v5-install.sh
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y apache2
+$STD apt-get install -y unzip
+$STD apt-get install -y apt-transport-https
+$STD apt-get install -y lsb-release
+msg_ok "Installed Dependencies"
+
+msg_info "Installing PHP 8.1"
+curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
+sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
+$STD apt-get update
+$STD apt-get install -y php8.1
+$STD apt-get install -y libapache2-mod-php8.1
+$STD apt-get install -y php8.1-sqlite3
+$STD apt-get install -y php8.1-gd
+$STD apt-get install -y php8.1-intl
+$STD apt-get install -y php8.1-mbstring
+msg_ok "Installed PHP 8.1"
+
+msg_info "Installing grocy"
+wget -q https://releases.grocy.info/latest
+$STD unzip latest -d /var/www/html
+chown -R www-data:www-data /var/www/html
+cp /var/www/html/config-dist.php /var/www/html/data/config.php
+chmod +x /var/www/html/update.sh
+
+cat </etc/apache2/sites-available/grocy.conf
+
+ ServerAdmin webmaster@localhost
+ DocumentRoot /var/www/html/public
+ ErrorLog /var/log/apache2/error.log
+
+ Options Indexes FollowSymLinks MultiViews
+ AllowOverride All
+ Order allow,deny
+ allow from all
+
+
+EOF
+
+$STD a2dissite 000-default.conf
+$STD a2ensite grocy.conf
+$STD a2enmod rewrite
+systemctl reload apache2
+msg_ok "Installed grocy"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+rm -rf /root/latest
+msg_ok "Cleaned"
diff --git a/install/heimdalldashboard-v5-install.sh b/install/heimdalldashboard-v5-install.sh
new file mode 100644
index 00000000..4fcc9888
--- /dev/null
+++ b/install/heimdalldashboard-v5-install.sh
@@ -0,0 +1,153 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing PHP"
+$STD apt-get install -y php
+$STD apt-get install -y php-sqlite3
+$STD apt-get install -y php-zip
+msg_ok "Installed PHP"
+
+RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]')
+msg_info "Installing Heimdall Dashboard ${RELEASE}"
+$STD curl --silent -o ${RELEASE}.tar.gz -L "https://github.com/linuxserver/Heimdall/archive/${RELEASE}.tar.gz"
+$STD tar xvzf ${RELEASE}.tar.gz
+VER=$(curl -s https://api.github.com/repos/linuxserver/Heimdall/releases/latest |
+ grep "tag_name" |
+ awk '{print substr($2, 3, length($2)-4) }')
+rm -rf ${RELEASE}.tar.gz
+mv Heimdall-${VER} /opt/Heimdall
+msg_ok "Installed Heimdall Dashboard ${RELEASE}"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/heimdall.service"
+echo "[Unit]
+Description=Heimdall
+After=network.target
+
+[Service]
+Restart=always
+RestartSec=5
+Type=simple
+User=root
+WorkingDirectory=/opt/Heimdall
+ExecStart="/usr/bin/php" artisan serve --port 7990 --host 0.0.0.0
+TimeoutStopSec=30
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+$STD sudo systemctl enable --now heimdall.service
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/homeassistant-core-v5-install.sh b/install/homeassistant-core-v5-install.sh
new file mode 100644
index 00000000..71f3186d
--- /dev/null
+++ b/install/homeassistant-core-v5-install.sh
@@ -0,0 +1,195 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies (Patience)"
+$STD apt-get install -y \
+ make \
+ build-essential \
+ libjpeg-dev \
+ libpcap-dev \
+ libssl-dev \
+ zlib1g-dev \
+ libbz2-dev \
+ libreadline-dev \
+ libsqlite3-dev \
+ libmariadb-dev-compat \
+ autoconf \
+ git \
+ curl \
+ sudo \
+ mc \
+ llvm \
+ libncursesw5-dev \
+ xz-utils \
+ tzdata \
+ bluez \
+ tk-dev \
+ libxml2-dev \
+ libxmlsec1-dev \
+ libffi-dev \
+ libopenjp2-7 \
+ libtiff5 \
+ libturbojpeg0-dev \
+ liblzma-dev
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Linux D-Bus Message Broker"
+cat <>/etc/apt/sources.list
+deb http://deb.debian.org/debian bullseye-backports main contrib non-free
+deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free
+EOF
+$STD apt-get update
+$STD apt-get -t bullseye-backports install -y dbus-broker
+$STD systemctl enable --now dbus-broker.service
+msg_ok "Installed Linux D-Bus Message Broker"
+
+msg_info "Installing pyenv"
+$STD git clone https://github.com/pyenv/pyenv.git ~/.pyenv
+set +e
+echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
+echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
+echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init --path)"\nfi' >> ~/.bashrc
+msg_ok "Installed pyenv"
+. ~/.bashrc
+set -e
+msg_info "Installing Python 3.11.1"
+$STD pyenv install 3.11.1
+pyenv global 3.11.1
+msg_ok "Installed Python 3.11.1"
+
+msg_info "Installing Home Assistant-Core"
+mkdir /srv/homeassistant
+cd /srv/homeassistant
+python3 -m venv .
+source bin/activate
+$STD pip install --upgrade pip
+$STD python3 -m pip install wheel
+$STD pip install mysqlclient
+$STD pip install psycopg2-binary
+$STD pip install homeassistant
+mkdir -p /root/.homeassistant
+msg_ok "Installed Home Assistant-Core"
+
+msg_info "Creating Service"
+cat </etc/systemd/system/homeassistant.service
+[Unit]
+Description=Home Assistant
+After=network-online.target
+[Service]
+Type=simple
+WorkingDirectory=/root/.homeassistant
+ExecStart=/srv/homeassistant/bin/hass -c "/root/.homeassistant"
+RestartForceExitStatus=100
+[Install]
+WantedBy=multi-user.target
+EOF
+$STD systemctl enable --now homeassistant
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/homeassistant-v5-install.sh b/install/homeassistant-v5-install.sh
new file mode 100644
index 00000000..12a5efbc
--- /dev/null
+++ b/install/homeassistant-v5-install.sh
@@ -0,0 +1,180 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing runlike"
+$STD apt-get install -y python3-pip
+$STD pip3 install runlike
+msg_ok "Installed runlike"
+
+get_latest_release() {
+ curl -sL https://api.github.com/repos/$1/releases/latest | grep '"tag_name":' | cut -d'"' -f4
+}
+
+DOCKER_LATEST_VERSION=$(get_latest_release "moby/moby")
+CORE_LATEST_VERSION=$(get_latest_release "home-assistant/core")
+PORTAINER_LATEST_VERSION=$(get_latest_release "portainer/portainer")
+
+msg_info "Installing Docker $DOCKER_LATEST_VERSION"
+DOCKER_CONFIG_PATH='/etc/docker/daemon.json'
+mkdir -p $(dirname $DOCKER_CONFIG_PATH)
+if [ "$ST" == "yes" ]; then
+VER=$(curl -s https://api.github.com/repos/containers/fuse-overlayfs/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
+cd /usr/local/bin
+curl -sSL -o fuse-overlayfs https://github.com/containers/fuse-overlayfs/releases/download/$VER/fuse-overlayfs-x86_64
+chmod 755 /usr/local/bin/fuse-overlayfs
+cd ~
+echo -e '{\n "storage-driver": "fuse-overlayfs",\n "log-driver": "journald"\n}' > /etc/docker/daemon.json
+else
+echo -e '{\n "log-driver": "journald"\n}' > /etc/docker/daemon.json
+fi
+$STD sh <(curl -sSL https://get.docker.com)
+msg_ok "Installed Docker $DOCKER_LATEST_VERSION"
+
+msg_info "Pulling Portainer $PORTAINER_LATEST_VERSION Image"
+$STD docker pull portainer/portainer-ce:latest
+msg_ok "Pulled Portainer $PORTAINER_LATEST_VERSION Image"
+
+msg_info "Installing Portainer $PORTAINER_LATEST_VERSION"
+$STD docker volume create portainer_data
+$STD docker run -d \
+ -p 8000:8000 \
+ -p 9000:9000 \
+ --name=portainer \
+ --restart=always \
+ -v /var/run/docker.sock:/var/run/docker.sock \
+ -v portainer_data:/data \
+ portainer/portainer-ce:latest
+msg_ok "Installed Portainer $PORTAINER_LATEST_VERSION"
+
+msg_info "Pulling Home Assistant $CORE_LATEST_VERSION Image"
+$STD docker pull homeassistant/home-assistant:stable
+msg_ok "Pulled Home Assistant $CORE_LATEST_VERSION Image"
+
+msg_info "Installing Home Assistant $CORE_LATEST_VERSION"
+$STD docker volume create hass_config
+$STD docker run -d \
+ --name homeassistant \
+ --privileged \
+ --restart unless-stopped \
+ -v /var/run/docker.sock:/var/run/docker.sock \
+ -v /dev:/dev \
+ -v hass_config:/config \
+ -v /etc/localtime:/etc/localtime:ro \
+ --net=host \
+ homeassistant/home-assistant:stable
+ mkdir /root/hass_config
+msg_ok "Installed Home Assistant $CORE_LATEST_VERSION"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/homebridge-v5-install.sh b/install/homebridge-v5-install.sh
new file mode 100644
index 00000000..ac0fec01
--- /dev/null
+++ b/install/homebridge-v5-install.sh
@@ -0,0 +1,132 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up Node.js Repository"
+$STD bash <(curl -fsSL https://deb.nodesource.com/setup_16.x)
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+$STD apt-get install -y nodejs gcc g++ make python net-tools
+msg_ok "Installed Node.js"
+
+msg_info "Installing Homebridge"
+$STD npm install -g --unsafe-perm homebridge homebridge-config-ui-x
+msg_info "Installed Homebridge"
+
+msg_info "Creating Service"
+$STD hb-service install --user homebridge
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/homepage-v5-install.sh b/install/homepage-v5-install.sh
new file mode 100644
index 00000000..ca0fe0c4
--- /dev/null
+++ b/install/homepage-v5-install.sh
@@ -0,0 +1,152 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y git
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up Node.js Repository"
+$STD bash <(curl -fsSL https://deb.nodesource.com/setup_16.x)
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+$STD apt-get install -y nodejs
+$STD npm install -g pnpm
+msg_ok "Installed Node.js"
+
+msg_info "Installing Homepage (Patience)"
+$STD git clone https://github.com/benphelps/homepage.git /opt/homepage
+cd /opt/homepage
+mkdir -p config
+cp /opt/homepage/src/skeleton/* /opt/homepage/config
+$STD pnpm install
+$STD pnpm build
+msg_ok "Installed Homepage"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/homepage.service"
+echo "[Unit]
+Description=Homepage
+After=network.target
+StartLimitIntervalSec=0
+[Service]
+Type=simple
+Restart=always
+RestartSec=1
+User=root
+WorkingDirectory=/opt/homepage/
+ExecStart=pnpm start
+[Install]
+WantedBy=multi-user.target" >$service_path
+$STD systemctl enable --now homepage
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/homer-v5-install.sh b/install/homer-v5-install.sh
new file mode 100644
index 00000000..539c4aed
--- /dev/null
+++ b/install/homer-v5-install.sh
@@ -0,0 +1,141 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y unzip
+$STD apt-get install -y pip
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Homer"
+mkdir -p /opt/homer
+cd /opt/homer
+wget -q https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip
+$STD unzip homer.zip
+rm -rf homer.zip
+cp assets/config.yml.dist assets/config.yml
+msg_ok "Installed Homer"
+
+msg_info "Creating Service"
+cat </etc/systemd/system/homer.service
+[Unit]
+Description=Homer Dashboard
+After=network-online.target
+[Service]
+Type=simple
+WorkingDirectory=/opt/homer
+ExecStart=python3 -m http.server 8010
+[Install]
+WantedBy=multi-user.target
+EOF
+$STD systemctl enable --now homer
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/hyperion-v5-install.sh b/install/hyperion-v5-install.sh
new file mode 100644
index 00000000..4e2668f2
--- /dev/null
+++ b/install/hyperion-v5-install.sh
@@ -0,0 +1,126 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y lsb-release
+$STD apt-get install -y gpg
+$STD apt-get install -y apt-transport-https
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Hyperion"
+wget -qO- https://apt.hyperion-project.org/hyperion.pub.key | gpg --dearmor -o /usr/share/keyrings/hyperion.pub.gpg
+sh -c 'echo "deb [signed-by=/usr/share/keyrings/hyperion.pub.gpg] https://apt.hyperion-project.org/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/hyperion.list'
+$STD apt-get update
+$STD apt-get install -y hyperion
+$STD systemctl enable --now hyperion@root.service
+msg_ok "Installed Hyperion"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove >/dev/null
+$STD apt-get autoclean >/dev/null
+msg_ok "Cleaned"
diff --git a/install/influxdb-v5-install.sh b/install/influxdb-v5-install.sh
new file mode 100644
index 00000000..31fe8ece
--- /dev/null
+++ b/install/influxdb-v5-install.sh
@@ -0,0 +1,149 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y lsb-base
+$STD apt-get install -y lsb-release
+$STD apt-get install -y gnupg2
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up InfluxDB Repository"
+wget -q https://repos.influxdata.com/influxdata-archive_compat.key
+cat influxdata-archive_compat.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null
+sh -c 'echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main" > /etc/apt/sources.list.d/influxdata.list'
+msg_ok "Set up InfluxDB Repository"
+
+read -r -p "Which version of InfluxDB to install? (1 or 2) " prompt
+if [[ $prompt == "2" ]]; then
+ INFLUX="2"
+else
+ INFLUX="1"
+fi
+
+msg_info "Installing InfluxDB"
+$STD apt-get update
+if [[ $INFLUX == "2" ]]; then
+ $STD apt-get install -y influxdb2
+else
+ $STD apt-get install -y influxdb
+fi
+$STD systemctl enable --now influxdb
+msg_ok "Installed InfluxDB"
+
+read -r -p "Would you like to add Telegraf? " prompt
+if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ msg_info "Installing Telegraf"
+ $STD apt-get install -y telegraf
+ msg_ok "Installed Telegraf"
+fi
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/iobroker-v5-install.sh b/install/iobroker-v5-install.sh
new file mode 100644
index 00000000..7c8152b3
--- /dev/null
+++ b/install/iobroker-v5-install.sh
@@ -0,0 +1,120 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing ioBroker (Patience)"
+$STD bash <(curl -fsSL https://iobroker.net/install.sh)
+msg_ok "Installed ioBroker"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/jackett-v5-install.sh b/install/jackett-v5-install.sh
new file mode 100644
index 00000000..7baee1b1
--- /dev/null
+++ b/install/jackett-v5-install.sh
@@ -0,0 +1,141 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Jackett"
+RELEASE=$(wget -q https://github.com/Jackett/Jackett/releases/latest -O - | grep "title>Release" | cut -d " " -f 4)
+wget -q https://github.com/Jackett/Jackett/releases/download/$RELEASE/Jackett.Binaries.LinuxAMDx64.tar.gz
+tar -xzf Jackett.Binaries.LinuxAMDx64.tar.gz -C /opt
+rm -rf Jackett.Binaries.LinuxAMDx64.tar.gz
+msg_ok "Installed Jackett"
+
+msg_info "Creating Service"
+cat </etc/systemd/system/jackett.service
+[Unit]
+Description=Jackett Daemon
+After=network.target
+[Service]
+SyslogIdentifier=jackett
+Restart=always
+RestartSec=5
+Type=simple
+WorkingDirectory=/opt/Jackett
+ExecStart=/bin/sh /opt/Jackett/jackett_launcher.sh
+TimeoutStopSec=30
+[Install]
+WantedBy=multi-user.target
+EOF
+systemctl enable -q --now jackett.service
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/jellyfin-v5-install.sh b/install/jellyfin-v5-install.sh
new file mode 100644
index 00000000..821bfe0e
--- /dev/null
+++ b/install/jellyfin-v5-install.sh
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y apt-transport-https
+$STD apt-get install -y software-properties-common
+msg_ok "Installed Dependencies"
+
+if [[ -z "$(grep -w "100000" /proc/self/uid_map)" ]]; then
+ msg_info "Setting Up Hardware Acceleration"
+ $STD apt-get -y install \
+ va-driver-all \
+ ocl-icd-libopencl1
+ if [[ ${PCT_OSVERSION} == "20.04" ]]; then
+ $STD apt-get install -y beignet-opencl-icd
+ else
+ $STD apt-get install -y intel-opencl-icd
+ fi
+ /bin/chgrp video /dev/dri
+ /bin/chmod 755 /dev/dri
+ /bin/chmod 660 /dev/dri/*
+ msg_ok "Set Up Hardware Acceleration"
+fi
+
+msg_info "Setting Up Jellyfin Repository"
+$STD add-apt-repository universe -y
+$STD apt-key add <(curl -fsSL https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key)
+sh -c 'echo "deb [arch=$(dpkg --print-architecture)] https://repo.jellyfin.org/ubuntu $(lsb_release -c -s) main" > /etc/apt/sources.list.d/jellyfin.list'
+msg_ok "Set Up Jellyfin Repository"
+
+msg_info "Installing Jellyfin"
+$STD apt-get update
+$STD apt install jellyfin-server -y
+$STD apt install jellyfin-ffmpeg5 -y
+msg_ok "Installed Jellyfin"
+
+msg_info "Creating Service"
+cat <<'EOF' >/lib/systemd/system/jellyfin.service
+[Unit]
+Description = Jellyfin Media Server
+After = network.target
+[Service]
+Type = simple
+EnvironmentFile = /etc/default/jellyfin
+User = root
+ExecStart = /usr/bin/jellyfin
+Restart = on-failure
+TimeoutSec = 15
+[Install]
+WantedBy = multi-user.target
+EOF
+ln -s /usr/share/jellyfin/web/ /usr/lib/jellyfin/bin/jellyfin-web
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/k0s-v5-install.sh b/install/k0s-v5-install.sh
new file mode 100644
index 00000000..c5bb38f5
--- /dev/null
+++ b/install/k0s-v5-install.sh
@@ -0,0 +1,130 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y git
+msg_ok "Installed Dependencies"
+
+msg_info "Installing k0s Kubernetes"
+$STD bash <(curl -sSLf https://get.k0s.sh)
+$STD k0s install controller --single
+$STD k0s start
+mkdir -p /etc/k0s
+k0s config create > /etc/k0s/k0s.yaml
+msg_ok "Installed k0s Kubernetes"
+
+read -r -p "Would you like to add Helm Package Manager? " prompt
+if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+msg_info "Installing Helm"
+$STD bash <(curl -sSLf https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3)
+msg_ok "Installed Helm"
+fi
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/kavita-v5-install.sh b/install/kavita-v5-install.sh
new file mode 100644
index 00000000..fb3d3af2
--- /dev/null
+++ b/install/kavita-v5-install.sh
@@ -0,0 +1,142 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+
+
+function error_exit() {
+ trap - ERR
+ local reason="Unknown failure occurred."
+ local msg="${1:-$reason}"
+ local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+ echo -e "$flag $msg" 1>&2
+ exit $EXIT
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Kavita"
+cd /opt
+RELEASE=$(curl -s https://api.github.com/repos/Kareadita/Kavita/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
+$STD tar -xvzf <(curl -fsSL https://github.com/Kareadita/Kavita/releases/download/$RELEASE/kavita-linux-x64.tar.gz) &&
+msg_ok "Installed Kavita"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/kavita.service"
+echo "[Unit]
+Description=Kavita Server
+After=network.target
+
+[Service]
+Type=simple
+WorkingDirectory=/opt/Kavita
+ExecStart=/opt/Kavita/Kavita
+TimeoutStopSec=20
+KillMode=process
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+chmod +x /opt/Kavita/* && chown root /opt/Kavita/*
+systemctl enable --now -q kavita.service
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/keycloak-v5-install.sh b/install/keycloak-v5-install.sh
new file mode 100644
index 00000000..65fc382c
--- /dev/null
+++ b/install/keycloak-v5-install.sh
@@ -0,0 +1,139 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies (Patience)"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y openjdk-11-jdk
+msg_ok "Installed Dependencies"
+
+RELEASE=$(curl -s https://api.github.com/repos/keycloak/keycloak/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
+msg_info "Installing Keycloak v$RELEASE"
+cd /opt
+wget -q https://github.com/keycloak/keycloak/releases/download/$RELEASE/keycloak-$RELEASE.tar.gz
+$STD tar -xvf keycloak-$RELEASE.tar.gz
+mv keycloak-$RELEASE keycloak
+msg_ok "Installed Keycloak"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/keycloak.service"
+echo "[Unit]
+Description=Keycloak
+After=network-online.target
+[Service]
+User=root
+WorkingDirectory=/opt/keycloak
+ExecStart=/opt/keycloak/bin/kc.sh start-dev
+[Install]
+WantedBy=multi-user.target" >$service_path
+$STD systemctl enable --now keycloak.service
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/lidarr-v5-install.sh b/install/lidarr-v5-install.sh
new file mode 100644
index 00000000..35354173
--- /dev/null
+++ b/install/lidarr-v5-install.sh
@@ -0,0 +1,147 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y sqlite3
+$STD apt-get install -y libchromaprint-tools
+$STD apt-get install -y mediainfo
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Lidarr"
+mkdir -p /var/lib/lidarr/
+chmod 775 /var/lib/lidarr/
+$STD wget --content-disposition 'https://lidarr.servarr.com/v1/update/master/updatefile?os=linux&runtime=netcore&arch=x64'
+$STD tar -xvzf Lidarr.master.*.tar.gz
+mv Lidarr /opt
+chmod 775 /opt/Lidarr
+msg_ok "Installed Lidarr"
+
+msg_info "Creating Service"
+cat </etc/systemd/system/lidarr.service
+[Unit]
+Description=Lidarr Daemon
+After=syslog.target network.target
+[Service]
+UMask=0002
+Type=simple
+ExecStart=/opt/Lidarr/Lidarr -nobrowser -data=/var/lib/lidarr/
+TimeoutStopSec=20
+KillMode=process
+Restart=on-failure
+[Install]
+WantedBy=multi-user.target
+EOF
+systemctl -q daemon-reload
+systemctl enable --now -q lidarr
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+rm -rf Lidarr.master.*.tar.gz
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/magicmirror-v5-install.sh b/install/magicmirror-v5-install.sh
new file mode 100644
index 00000000..3cfc369d
--- /dev/null
+++ b/install/magicmirror-v5-install.sh
@@ -0,0 +1,244 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y git
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up Node.js Repository"
+$STD bash <(curl -fsSL https://deb.nodesource.com/setup_16.x)
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+$STD apt-get install -y nodejs
+msg_ok "Installed Node.js"
+
+msg_info "Setting up MagicMirror Repository"
+$STD git clone https://github.com/MichMich/MagicMirror /opt/magicmirror
+msg_ok "Set up MagicMirror Repository"
+
+msg_info "Installing MagicMirror"
+cd /opt/magicmirror
+$STD npm install --only=prod --omit=dev
+
+cat </opt/magicmirror/config/config.js
+let config = {
+ address: "0.0.0.0",
+ port: 8080,
+ basePath: "/",
+ ipWhitelist: [],
+ useHttps: false,
+ httpsPrivateKey: "",
+ httpsCertificate: "",
+ language: "en",
+ locale: "en-US",
+ logLevel: ["INFO", "LOG", "WARN", "ERROR"],
+ timeFormat: 24,
+ units: "metric",
+ serverOnly: true,
+ modules: [
+ {
+ module: "alert",
+ },
+ {
+ module: "updatenotification",
+ position: "top_bar"
+ },
+ {
+ module: "clock",
+ position: "top_left"
+ },
+ {
+ module: "calendar",
+ header: "US Holidays",
+ position: "top_left",
+ config: {
+ calendars: [
+ {
+ symbol: "calendar-check",
+ url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics"
+ }
+ ]
+ }
+ },
+ {
+ module: "compliments",
+ position: "lower_third"
+ },
+ {
+ module: "weather",
+ position: "top_right",
+ config: {
+ weatherProvider: "openweathermap",
+ type: "current",
+ location: "New York",
+ locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
+ apiKey: "YOUR_OPENWEATHER_API_KEY"
+ }
+ },
+ {
+ module: "weather",
+ position: "top_right",
+ header: "Weather Forecast",
+ config: {
+ weatherProvider: "openweathermap",
+ type: "forecast",
+ location: "New York",
+ locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
+ apiKey: "YOUR_OPENWEATHER_API_KEY"
+ }
+ },
+ {
+ module: "newsfeed",
+ position: "bottom_bar",
+ config: {
+ feeds: [
+ {
+ title: "New York Times",
+ url: "https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml"
+ }
+ ],
+ showSourceTitle: true,
+ showPublishDate: true,
+ broadcastNewsFeeds: true,
+ broadcastNewsUpdates: true
+ }
+ },
+ ]
+};
+
+/*************** DO NOT EDIT THE LINE BELOW ***************/
+if (typeof module !== "undefined") {module.exports = config;}
+EOF
+msg_ok "Installed MagicMirror"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/magicmirror.service"
+echo "[Unit]
+Description=Magic Mirror
+After=network.target
+StartLimitIntervalSec=0
+
+[Service]
+Type=simple
+Restart=always
+RestartSec=1
+User=root
+WorkingDirectory=/opt/magicmirror/
+ExecStart=/usr/bin/node serveronly
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+$STD systemctl enable --now magicmirror
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/mariadb-v5-install.sh b/install/mariadb-v5-install.sh
new file mode 100644
index 00000000..63b2899e
--- /dev/null
+++ b/install/mariadb-v5-install.sh
@@ -0,0 +1,131 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing MariaDB"
+$STD bash <(curl -fsSL https://r.mariadb.com/downloads/mariadb_repo_setup)
+$STD apt-get update
+$STD apt-get install -y mariadb-server
+msg_ok "Installed MariaDB"
+
+read -r -p "Would you like to add Adminer? " prompt
+if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ msg_info "Installing Adminer"
+ $STD apt install -y adminer
+ $STD a2enconf adminer
+ systemctl reload apache2
+ msg_ok "Installed Adminer"
+fi
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/meshcentral-v5-install.sh b/install/meshcentral-v5-install.sh
new file mode 100644
index 00000000..f0b22abb
--- /dev/null
+++ b/install/meshcentral-v5-install.sh
@@ -0,0 +1,131 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up Node.js Repository"
+$STD bash <(curl -fsSL https://deb.nodesource.com/setup_16.x)
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+$STD apt-get install -y nodejs
+msg_ok "Installed Node.js"
+
+msg_info "Installing MeshCentral"
+mkdir /opt/meshcentral
+cd /opt/meshcentral
+$STD npm install meshcentral
+$STD node node_modules/meshcentral --install
+msg_ok "Installed MeshCentral"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/motioneye-v5-install.sh b/install/motioneye-v5-install.sh
new file mode 100644
index 00000000..14ea8991
--- /dev/null
+++ b/install/motioneye-v5-install.sh
@@ -0,0 +1,150 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y cifs-utils
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Motion"
+$STD apt-get install -y motion
+systemctl stop motion
+$STD systemctl disable motion
+msg_ok "Installed Motion"
+
+msg_info "Installing FFmpeg"
+$STD apt-get install -y ffmpeg v4l-utils
+msg_ok "Installed FFmpeg"
+
+msg_info "Installing Python"
+$STD apt-get update
+$STD apt-get install -y python2
+curl -sSL https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
+$STD python2 get-pip.py
+$STD apt-get install -y libffi-dev libzbar-dev libzbar0
+$STD apt-get install -y python2-dev libssl-dev libcurl4-openssl-dev libjpeg-dev
+msg_ok "Installed Python"
+
+msg_info "Installing MotionEye"
+$STD apt-get update
+$STD pip install motioneye
+mkdir -p /etc/motioneye
+cp /usr/local/share/motioneye/extra/motioneye.conf.sample /etc/motioneye/motioneye.conf
+mkdir -p /var/lib/motioneye
+msg_ok "Installed MotionEye"
+
+msg_info "Creating Service"
+cp /usr/local/share/motioneye/extra/motioneye.systemd-unit-local /etc/systemd/system/motioneye.service
+$STD systemctl enable motioneye
+systemctl start motioneye
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/mqtt-v5-install.sh b/install/mqtt-v5-install.sh
new file mode 100644
index 00000000..3f13f8a4
--- /dev/null
+++ b/install/mqtt-v5-install.sh
@@ -0,0 +1,127 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y gnupg
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Mosquitto MQTT Broker"
+$STD wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
+$STD apt-key add mosquitto-repo.gpg.key
+cd /etc/apt/sources.list.d/
+$STD wget http://repo.mosquitto.org/debian/mosquitto-bullseye.list
+$STD apt-get update
+$STD apt-get -y install mosquitto
+$STD apt-get -y install mosquitto-clients
+msg_ok "Installed Mosquitto MQTT Broker"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/n8n-v5-install.sh b/install/n8n-v5-install.sh
new file mode 100644
index 00000000..76a45c05
--- /dev/null
+++ b/install/n8n-v5-install.sh
@@ -0,0 +1,142 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up Node.js Repository"
+$STD bash <(curl -fsSL https://deb.nodesource.com/setup_16.x)
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+$STD apt-get install -y nodejs
+msg_ok "Installed Node.js"
+
+msg_info "Installing n8n (Patience)"
+$STD npm install --global n8n
+msg_ok "Installed n8n"
+
+msg_info "Creating Service"
+cat </etc/systemd/system/n8n.service
+[Unit]
+Description=n8n
+
+[Service]
+Type=simple
+ExecStart=n8n start
+[Install]
+WantedBy=multi-user.target
+EOF
+$STD systemctl enable --now n8n
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/navidrome-v5-install.sh b/install/navidrome-v5-install.sh
new file mode 100644
index 00000000..67a38067
--- /dev/null
+++ b/install/navidrome-v5-install.sh
@@ -0,0 +1,171 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies (patience)"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y ffmpeg
+msg_ok "Installed Dependencies"
+
+RELEASE=$(curl -s https://api.github.com/repos/navidrome/navidrome/releases/latest |
+ grep "tag_name" |
+ awk '{print substr($2, 3, length($2)-4) }')
+
+msg_info "Installing Navidrome"
+install -d -o root -g root /opt/navidrome
+install -d -o root -g root /var/lib/navidrome
+$STD wget https://github.com/navidrome/navidrome/releases/download/v${RELEASE}/navidrome_${RELEASE}_Linux_x86_64.tar.gz -O Navidrome.tar.gz
+$STD tar -xvzf Navidrome.tar.gz -C /opt/navidrome/
+chown -R root:root /opt/navidrome
+mkdir -p /music
+cat </var/lib/navidrome/navidrome.toml
+MusicFolder = '/music'
+EOF
+msg_ok "Installed Navidrome"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/navidrome.service"
+
+echo "[Unit]
+Description=Navidrome Music Server and Streamer compatible with Subsonic/Airsonic
+After=remote-fs.target network.target
+AssertPathExists=/var/lib/navidrome
+
+[Service]
+User=root
+Group=root
+Type=simple
+ExecStart=/opt/navidrome/navidrome --configfile '/var/lib/navidrome/navidrome.toml'
+WorkingDirectory=/var/lib/navidrome
+TimeoutStopSec=20
+KillMode=process
+Restart=on-failure
+DevicePolicy=closed
+NoNewPrivileges=yes
+PrivateTmp=yes
+PrivateUsers=yes
+ProtectControlGroups=yes
+ProtectKernelModules=yes
+ProtectKernelTunables=yes
+RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
+RestrictNamespaces=yes
+RestrictRealtime=yes
+SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap
+ReadWritePaths=/var/lib/navidrome
+ProtectSystem=full
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+systemctl daemon-reload
+$STD systemctl enable --now navidrome.service
+
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+rm -rf /root/Navidrome.tar.gz
+msg_ok "Cleaned"
diff --git a/install/nextcloudpi-v5-install.sh b/install/nextcloudpi-v5-install.sh
new file mode 100644
index 00000000..6ccada06
--- /dev/null
+++ b/install/nextcloudpi-v5-install.sh
@@ -0,0 +1,122 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing NextCloudPi (Patience)"
+$STD bash <(curl -fsSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh)
+sed -i "s/3 => 'nextcloudpi.lan',/3 => '0.0.0.0',/g" /var/www/nextcloud/config/config.php
+sed -i '{s|root:/usr/sbin/nologin|root:/bin/bash|g}' /etc/passwd
+service apache2 restart
+msg_ok "Installed NextCloudPi"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/nginxproxymanager-v5-install.sh b/install/nginxproxymanager-v5-install.sh
new file mode 100644
index 00000000..830c02fa
--- /dev/null
+++ b/install/nginxproxymanager-v5-install.sh
@@ -0,0 +1,280 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get update
+$STD apt-get -y install \
+ sudo \
+ mc \
+ curl \
+ gnupg \
+ make \
+ g++ \
+ gcc \
+ ca-certificates \
+ apache2-utils \
+ logrotate \
+ build-essential \
+ python3-dev \
+ git \
+ lsb-release
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Python"
+$STD apt-get install -y -q --no-install-recommends python3 python3-pip python3-venv
+$STD pip3 install --upgrade setuptools
+$STD pip3 install --upgrade pip
+$STD python3 -m venv /opt/certbot/
+if [ "$(getconf LONG_BIT)" = "32" ]; then
+ $STD python3 -m pip install --no-cache-dir -U cryptography==3.3.2
+fi
+$STD python3 -m pip install --no-cache-dir cffi certbot
+msg_ok "Installed Python"
+
+msg_info "Installing Openresty"
+$STD apt-key add <(curl -fsSL https://openresty.org/package/pubkey.gpg)
+sh -c 'echo "deb http://openresty.org/package/debian $(lsb_release -cs) openresty" > /etc/apt/sources.list.d/openresty.list'
+$STD apt-get -y update
+$STD apt-get -y install --no-install-recommends openresty
+msg_ok "Installed Openresty"
+
+msg_info "Setting up Node.js Repository"
+$STD bash <(curl -fsSL https://deb.nodesource.com/setup_16.x)
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+$STD apt-get install -y nodejs
+msg_ok "Installed Node.js"
+
+msg_info "Installing Yarn"
+$STD npm install --global yarn
+msg_ok "Installed Yarn"
+
+RELEASE=$(curl -s https://api.github.com/repos/NginxProxyManager/nginx-proxy-manager/releases/latest |
+ grep "tag_name" |
+ awk '{print substr($2, 3, length($2)-4) }')
+
+msg_info "Downloading Nginx Proxy Manager v${RELEASE}"
+wget -q https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v${RELEASE} -O - | tar -xz
+cd ./nginx-proxy-manager-${RELEASE}
+msg_ok "Downloaded Nginx Proxy Manager v${RELEASE}"
+
+msg_info "Setting up Enviroment"
+ln -sf /usr/bin/python3 /usr/bin/python
+ln -sf /usr/bin/certbot /opt/certbot/bin/certbot
+ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx
+ln -sf /usr/local/openresty/nginx/ /etc/nginx
+
+sed -i "s+0.0.0+${RELEASE}+g" backend/package.json
+sed -i "s+0.0.0+${RELEASE}+g" frontend/package.json
+
+sed -i 's+^daemon+#daemon+g' docker/rootfs/etc/nginx/nginx.conf
+NGINX_CONFS=$(find "$(pwd)" -type f -name "*.conf")
+for NGINX_CONF in $NGINX_CONFS; do
+ sed -i 's+include conf.d+include /etc/nginx/conf.d+g' "$NGINX_CONF"
+done
+
+mkdir -p /var/www/html /etc/nginx/logs
+cp -r docker/rootfs/var/www/html/* /var/www/html/
+cp -r docker/rootfs/etc/nginx/* /etc/nginx/
+cp docker/rootfs/etc/letsencrypt.ini /etc/letsencrypt.ini
+cp docker/rootfs/etc/logrotate.d/nginx-proxy-manager /etc/logrotate.d/nginx-proxy-manager
+ln -sf /etc/nginx/nginx.conf /etc/nginx/conf/nginx.conf
+rm -f /etc/nginx/conf.d/dev.conf
+
+mkdir -p /tmp/nginx/body \
+ /run/nginx \
+ /data/nginx \
+ /data/custom_ssl \
+ /data/logs \
+ /data/access \
+ /data/nginx/default_host \
+ /data/nginx/default_www \
+ /data/nginx/proxy_host \
+ /data/nginx/redirection_host \
+ /data/nginx/stream \
+ /data/nginx/dead_host \
+ /data/nginx/temp \
+ /var/lib/nginx/cache/public \
+ /var/lib/nginx/cache/private \
+ /var/cache/nginx/proxy_temp
+
+chmod -R 777 /var/cache/nginx
+chown root /tmp/nginx
+
+echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf);" >/etc/nginx/conf.d/include/resolvers.conf
+
+if [ ! -f /data/nginx/dummycert.pem ] || [ ! -f /data/nginx/dummykey.pem ]; then
+ echo -en "${GN} Generating dummy SSL Certificate... "
+ openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 -subj "/O=Nginx Proxy Manager/OU=Dummy Certificate/CN=localhost" -keyout /data/nginx/dummykey.pem -out /data/nginx/dummycert.pem &>/dev/null
+fi
+
+mkdir -p /app/global /app/frontend/images
+cp -r backend/* /app
+cp -r global/* /app/global
+msg_ok "Set up Enviroment"
+
+msg_info "Building Frontend"
+cd ./frontend
+export NODE_ENV=development
+$STD yarn install --network-timeout=30000
+$STD yarn build
+cp -r dist/* /app/frontend
+cp -r app-images/* /app/frontend/images
+msg_ok "Built Frontend"
+
+msg_info "Initializing Backend"
+rm -rf /app/config/default.json
+if [ ! -f /app/config/production.json ]; then
+ cat <<'EOF' >/app/config/production.json
+{
+ "database": {
+ "engine": "knex-native",
+ "knex": {
+ "client": "sqlite3",
+ "connection": {
+ "filename": "/data/database.sqlite"
+ }
+ }
+ }
+}
+EOF
+fi
+cd /app
+export NODE_ENV=development
+$STD yarn install --network-timeout=30000
+msg_ok "Initialized Backend"
+
+msg_info "Creating Service"
+cat <<'EOF' >/lib/systemd/system/npm.service
+[Unit]
+Description=Nginx Proxy Manager
+After=network.target
+Wants=openresty.service
+
+[Service]
+Type=simple
+Environment=NODE_ENV=production
+ExecStartPre=-mkdir -p /tmp/nginx/body /data/letsencrypt-acme-challenge
+ExecStart=/usr/bin/node index.js --abort_on_uncaught_exception --max_old_space_size=250
+WorkingDirectory=/app
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
+EOF
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Starting Services"
+$STD systemctl enable --now openresty
+$STD systemctl enable --now npm
+msg_ok "Started Services"
+
+msg_info "Cleaning up"
+rm -rf ../nginx-proxy-manager-*
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/nocodb-v5-install.sh b/install/nocodb-v5-install.sh
new file mode 100644
index 00000000..fb618460
--- /dev/null
+++ b/install/nocodb-v5-install.sh
@@ -0,0 +1,149 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y git
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up Node.js Repository"
+$STD bash <(curl -fsSL https://deb.nodesource.com/setup_16.x)
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+$STD sudo apt-get install -y nodejs git make g++ gcc
+msg_ok "Installed Node.js"
+
+msg_info "Installing NocoDB"
+$STD git clone https://github.com/nocodb/nocodb-seed
+mv nocodb-seed /opt/nocodb
+cd /opt/nocodb
+$STD npm install
+msg_ok "Installed NocoDB"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/nocodb.service"
+echo "[Unit]
+Description=nocodb
+
+[Service]
+Type=simple
+Restart=always
+User=root
+WorkingDirectory=/opt/nocodb
+ExecStart=/usr/bin/npm start
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+systemctl enable --now nocodb.service &>/dev/null
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/node-red-v5-install.sh b/install/node-red-v5-install.sh
new file mode 100644
index 00000000..e20934ef
--- /dev/null
+++ b/install/node-red-v5-install.sh
@@ -0,0 +1,152 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y git
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up Node.js Repository"
+$STD bash <(curl -fsSL https://deb.nodesource.com/setup_18.x)
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+$STD apt-get install -y nodejs
+msg_ok "Installed Node.js"
+
+msg_info "Installing Node-Red"
+$STD npm install -g --unsafe-perm node-red
+msg_ok "Installed Node-Red"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/nodered.service"
+echo "[Unit]
+Description=Node-RED
+After=syslog.target network.target
+
+[Service]
+ExecStart=/usr/bin/node-red --max-old-space-size=128 -v
+Restart=on-failure
+KillSignal=SIGINT
+
+SyslogIdentifier=node-red
+StandardOutput=syslog
+
+WorkingDirectory=/root/
+User=root
+Group=root
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+$STD systemctl enable --now nodered.service
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/omada-v5-install.sh b/install/omada-v5-install.sh
new file mode 100644
index 00000000..6e79e690
--- /dev/null
+++ b/install/omada-v5-install.sh
@@ -0,0 +1,127 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y gnupg
+$STD apt-get install -y openjdk-8-jre-headless
+$STD apt-get install -y jsvc
+wget -qL https://repo.mongodb.org/apt/ubuntu/dists/bionic/mongodb-org/3.6/multiverse/binary-amd64/mongodb-org-server_3.6.23_amd64.deb
+$STD dpkg -i mongodb-org-server_3.6.23_amd64.deb
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Omada Controller v5.9.9"
+wget -qL https://static.tp-link.com/upload/software/2023/202302/20230227/Omada_SDN_Controller_v5.9.9_Linux_x64.deb
+$STD dpkg -i Omada_SDN_Controller_v5.9.9_Linux_x64.deb
+msg_ok "Installed Omada Controller"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+rm -rf Omada_SDN_Controller_v5.9.9_Linux_x64.deb mongodb-org-server_3.6.23_amd64.deb
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/omv-v5-install.sh b/install/omv-v5-install.sh
new file mode 100644
index 00000000..6f0e8a1e
--- /dev/null
+++ b/install/omv-v5-install.sh
@@ -0,0 +1,138 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+export DEBIAN_FRONTEND=noninteractive
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y gnupg
+msg_ok "Installed Dependencies"
+
+msg_info "Installing OpenMediaVault (Patience)"
+wget -q -O "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" https://packages.openmediavault.org/public/archive.key
+$STD apt-key add "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" &>/dev/null
+
+cat <>/etc/apt/sources.list.d/openmediavault.list
+deb https://packages.openmediavault.org/public shaitan main
+# deb https://downloads.sourceforge.net/project/openmediavault/packages shaitan main
+## Uncomment the following line to add software from the proposed repository.
+# deb https://packages.openmediavault.org/public shaitan-proposed main
+# deb https://downloads.sourceforge.net/project/openmediavault/packages shaitan-proposed main
+## This software is not part of OpenMediaVault, but is offered by third-party
+## developers as a service to OpenMediaVault users.
+# deb https://packages.openmediavault.org/public shaitan partner
+# deb https://downloads.sourceforge.net/project/openmediavault/packages shaitan partner
+EOF
+$STD apt-get update
+$STD apt-get -y install openmediavault-keyring
+$STD apt-get --yes --auto-remove --show-upgraded --allow-downgrades --allow-change-held-packages --no-install-recommends install openmediavault
+omv-confdbadm populate
+msg_ok "Installed OpenMediaVault"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/openhab-v5-install.sh b/install/openhab-v5-install.sh
new file mode 100644
index 00000000..1899ae34
--- /dev/null
+++ b/install/openhab-v5-install.sh
@@ -0,0 +1,137 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y gnupg
+$STD apt-get install -y apt-transport-https
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Azul Zulu"
+$STD apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
+wget -q https://cdn.azul.com/zulu/bin/zulu-repo_1.0.0-3_all.deb
+$STD apt-get install ./zulu-repo_1.0.0-3_all.deb
+$STD apt-get update
+$STD apt-get -y install zulu11-jdk
+msg_ok "Installed Azul Zulu"
+
+msg_info "Installing openHAB"
+curl -fsSL "https://openhab.jfrog.io/artifactory/api/gpg/key/public" | gpg --dearmor >openhab.gpg
+mv openhab.gpg /usr/share/keyrings
+chmod u=rw,g=r,o=r /usr/share/keyrings/openhab.gpg
+sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/openhab.gpg] https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main" > /etc/apt/sources.list.d/openhab.list'
+$STD apt update
+$STD apt-get -y install openhab
+systemctl daemon-reload
+$STD systemctl enable --now openhab.service
+msg_ok "Installed openHAB"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/paperless-ngx-v5-install.sh b/install/paperless-ngx-v5-install.sh
new file mode 100644
index 00000000..5efaa813
--- /dev/null
+++ b/install/paperless-ngx-v5-install.sh
@@ -0,0 +1,290 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Python3"
+$STD apt-get install -y --no-install-recommends \
+ python3 \
+ python3-pip \
+ python3-dev \
+ python3-setuptools \
+ python3-wheel
+msg_ok "Installed Python3"
+
+msg_info "Installing Dependencies (Patience)"
+$STD apt-get install -y --no-install-recommends \
+ redis \
+ postgresql \
+ build-essential \
+ imagemagick \
+ fonts-liberation \
+ optipng \
+ gnupg \
+ libpq-dev \
+ libmagic-dev \
+ mime-support \
+ libzbar0 \
+ poppler-utils \
+ default-libmysqlclient-dev \
+ automake \
+ libtool \
+ pkg-config \
+ git \
+ curl \
+ libtiff-dev \
+ libpng-dev \
+ libleptonica-dev \
+ sudo \
+ mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing OCR Dependencies (Patience)"
+$STD apt-get install -y --no-install-recommends \
+ unpaper \
+ ghostscript \
+ icc-profiles-free \
+ qpdf \
+ liblept5 \
+ libxml2 \
+ pngquant \
+ zlib1g \
+ tesseract-ocr \
+ tesseract-ocr-eng
+msg_ok "Installed OCR Dependencies"
+
+msg_info "Installing JBIG2"
+$STD git clone https://github.com/agl/jbig2enc /opt/jbig2enc
+cd /opt/jbig2enc
+$STD bash ./autogen.sh
+$STD bash ./configure
+$STD make
+$STD make install
+rm -rf /opt/jbig2enc
+msg_ok "Installed JBIG2"
+
+msg_info "Installing Paperless-ngx (Patience)"
+Paperlessngx=$(wget -q https://github.com/paperless-ngx/paperless-ngx/releases/latest -O - | grep "title>Release" | cut -d " " -f 5)
+cd /opt
+$STD wget https://github.com/paperless-ngx/paperless-ngx/releases/download/$Paperlessngx/paperless-ngx-$Paperlessngx.tar.xz
+$STD tar -xf paperless-ngx-$Paperlessngx.tar.xz -C /opt/
+mv paperless-ngx paperless
+rm paperless-ngx-$Paperlessngx.tar.xz
+cd /opt/paperless
+## python 3.10+ doesn't like the '-e', so we remove it from this the requirements file
+sed -i -e 's|-e git+https://github.com/paperless-ngx/django-q.git|git+https://github.com/paperless-ngx/django-q.git|' /opt/paperless/requirements.txt
+$STD pip install --upgrade pip
+$STD pip install -r requirements.txt
+curl -s -o /opt/paperless/paperless.conf https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/paperless.conf.example
+msg_ok "Installed Paperless-ngx"
+
+msg_info "Installing Natural Language Toolkit (Patience)"
+$STD python3 -m nltk.downloader -d /usr/share/nltk_data all
+msg_ok "Installed Natural Language Toolkit"
+
+msg_info "Setting up database"
+DB_USER=paperless
+DB_PASS="$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13)"
+DB_NAME=paperlessdb
+$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
+$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER TEMPLATE template0;"
+echo "Paperless-ngx Database User" >>~/paperless.creds
+echo $DB_USER >>~/paperless.creds
+echo "Paperless-ngx Database Password" >>~/paperless.creds
+echo $DB_PASS >>~/paperless.creds
+echo "Paperless-ngx Database Name" >>~/paperless.creds
+echo $DB_NAME >>~/paperless.creds
+mkdir -p {consume,media}
+sed -i -e 's|#PAPERLESS_DBNAME=paperless|PAPERLESS_DBNAME=paperlessdb|' /opt/paperless/paperless.conf
+sed -i -e "s|#PAPERLESS_DBPASS=paperless|PAPERLESS_DBPASS=$DB_PASS|" /opt/paperless/paperless.conf
+SECRET_KEY="$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)"
+sed -i -e "s|#PAPERLESS_SECRET_KEY=change-me|PAPERLESS_SECRET_KEY=$SECRET_KEY|" /opt/paperless/paperless.conf
+cd /opt/paperless/src
+$STD python3 manage.py migrate
+msg_ok "Set up database"
+
+msg_info "Setting up admin Paperless-ngx User & Password"
+## From https://github.com/linuxserver/docker-paperless-ngx/blob/main/root/etc/cont-init.d/99-migrations
+cat <>~/paperless.creds
+echo "Paperless-ngx WebUI User" >>~/paperless.creds
+echo admin >>~/paperless.creds
+echo "Paperless-ngx WebUI Password" >>~/paperless.creds
+echo $DB_PASS >>~/paperless.creds
+msg_ok "Set up admin Paperless-ngx User & Password"
+
+msg_info "Creating Services"
+cat </etc/systemd/system/paperless-scheduler.service
+[Unit]
+Description=Paperless Celery beat
+Requires=redis.service
+
+[Service]
+WorkingDirectory=/opt/paperless/src
+ExecStart=celery --app paperless beat --loglevel INFO
+
+[Install]
+WantedBy=multi-user.target
+EOF
+
+cat </etc/systemd/system/paperless-task-queue.service
+[Unit]
+Description=Paperless Celery Workers
+Requires=redis.service
+
+[Service]
+WorkingDirectory=/opt/paperless/src
+ExecStart=celery --app paperless worker --loglevel INFO
+
+[Install]
+WantedBy=multi-user.target
+EOF
+
+cat </etc/systemd/system/paperless-consumer.service
+[Unit]
+Description=Paperless consumer
+Requires=redis.service
+
+[Service]
+WorkingDirectory=/opt/paperless/src
+ExecStart=python3 manage.py document_consumer
+
+[Install]
+WantedBy=multi-user.target
+EOF
+
+cat </etc/systemd/system/paperless-webserver.service
+[Unit]
+Description=Paperless webserver
+After=network.target
+Wants=network.target
+Requires=redis.service
+
+[Service]
+WorkingDirectory=/opt/paperless/src
+ExecStart=/usr/local/bin/gunicorn -c /opt/paperless/gunicorn.conf.py paperless.asgi:application
+
+[Install]
+WantedBy=multi-user.target
+EOF
+
+sed -i -e 's/rights="none" pattern="PDF"/rights="read|write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml
+
+systemctl daemon-reload
+$STD systemctl enable --now paperless-consumer paperless-webserver paperless-scheduler paperless-task-queue.service
+
+msg_ok "Created Services"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/photoprism-v5-install.sh b/install/photoprism-v5-install.sh
new file mode 100644
index 00000000..ac39c48d
--- /dev/null
+++ b/install/photoprism-v5-install.sh
@@ -0,0 +1,223 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies (Patience)"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y gcc
+$STD apt-get install -y g++
+$STD apt-get install -y git
+$STD apt-get install -y gnupg
+$STD apt-get install -y make
+$STD apt-get install -y zip
+$STD apt-get install -y unzip
+$STD apt-get install -y exiftool
+$STD apt-get install -y ffmpeg
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up Node.js Repository"
+$STD bash <(curl -fsSL https://deb.nodesource.com/setup_18.x)
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+$STD apt-get -y install nodejs
+msg_ok "Installed Node.js"
+
+msg_info "Installing Golang"
+set +o pipefail
+RELEASE=$(curl -s https://go.dev/dl/ | grep -o "go.*\linux-amd64.tar.gz" | head -n 1)
+wget -q https://golang.org/dl/$RELEASE
+$STD tar -xzf $RELEASE -C /usr/local
+$STD ln -s /usr/local/go/bin/go /usr/local/bin/go
+msg_ok "Installed Golang"
+
+msg_info "Installing Go Dependencies"
+$STD go install github.com/tianon/gosu@latest
+$STD go install golang.org/x/tools/cmd/goimports@latest
+$STD go install github.com/psampaz/go-mod-outdated@latest
+$STD go install github.com/dsoprea/go-exif/v3/command/exif-read-tool@latest
+$STD go install github.com/mikefarah/yq/v4@latest
+$STD go install github.com/kyoh86/richgo@latest
+cp /root/go/bin/* /usr/local/go/bin/
+cp /usr/local/go/bin/richgo /usr/local/bin/richgo
+cp /usr/local/go/bin/gosu /usr/local/sbin/gosu
+chown root:root /usr/local/sbin/gosu
+chmod 755 /usr/local/sbin/gosu
+msg_ok "Installed Go Dependencies"
+
+msg_info "Installing Tensorflow"
+if grep -q avx2 /proc/cpuinfo; then
+ suffix="avx2-"
+elif grep -q avx /proc/cpuinfo; then
+ suffix="avx-"
+else
+ suffix="1"
+fi
+version=$(curl -s https://dl.photoprism.org/tensorflow/amd64/ | grep -o "libtensorflow-amd64-$suffix.*\\.tar.gz" | head -n 1)
+wget -q https://dl.photoprism.org/tensorflow/amd64/$version
+tar -C /usr/local -xzf $version
+ldconfig
+set -o pipefail
+msg_ok "Installed Tensorflow"
+
+msg_info "Cloning PhotoPrism"
+mkdir -p /opt/photoprism/bin
+mkdir -p /var/lib/photoprism/storage
+$STD git clone https://github.com/photoprism/photoprism.git
+cd photoprism
+$STD git checkout release
+msg_ok "Cloned PhotoPrism"
+
+msg_info "Building PhotoPrism (Patience)"
+$STD make -B
+$STD ./scripts/build.sh prod /opt/photoprism/bin/photoprism
+$STD cp -r assets/ /opt/photoprism/
+msg_ok "Built PhotoPrism"
+
+env_path="/var/lib/photoprism/.env"
+echo "
+PHOTOPRISM_AUTH_MODE='password'
+PHOTOPRISM_ADMIN_PASSWORD='changeme'
+PHOTOPRISM_HTTP_HOST='0.0.0.0'
+PHOTOPRISM_HTTP_PORT='2342'
+PHOTOPRISM_SITE_CAPTION='https://tteck.github.io/Proxmox/'
+PHOTOPRISM_STORAGE_PATH='/var/lib/photoprism/storage'
+PHOTOPRISM_ORIGINALS_PATH='/var/lib/photoprism/photos/Originals'
+PHOTOPRISM_IMPORT_PATH='/var/lib/photoprism/photos/Import'
+" >$env_path
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/photoprism.service"
+
+echo "[Unit]
+Description=PhotoPrism service
+After=network.target
+
+[Service]
+Type=forking
+User=root
+WorkingDirectory=/opt/photoprism
+EnvironmentFile=/var/lib/photoprism/.env
+ExecStart=/opt/photoprism/bin/photoprism up -d
+ExecStop=/opt/photoprism/bin/photoprism down
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+rm -rf /var/{cache,log}/* \
+ /photoprism \
+ /$RELEASE \
+ /$version
+msg_ok "Cleaned"
+
+msg_info "Starting PhotoPrism"
+systemctl enable -q --now photoprism
+msg_ok "Started PhotoPrism"
diff --git a/install/pihole-v5-install.sh b/install/pihole-v5-install.sh
new file mode 100644
index 00000000..63df2f5b
--- /dev/null
+++ b/install/pihole-v5-install.sh
@@ -0,0 +1,143 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+export DEBIAN_FRONTEND=noninteractive
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y ufw
+$STD apt-get install -y ntp
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Pi-hole"
+systemctl stop systemd-resolved
+echo "DNSStubListener=no" >>/etc/systemd/resolved.conf
+ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
+mkdir -p /etc/pihole/
+cat </etc/pihole/setupVars.conf
+PIHOLE_INTERFACE=eth0
+PIHOLE_DNS_1=8.8.8.8
+PIHOLE_DNS_2=8.8.4.4
+QUERY_LOGGING=true
+INSTALL_WEB_SERVER=true
+INSTALL_WEB_INTERFACE=true
+LIGHTTPD_ENABLED=true
+CACHE_SIZE=10000
+DNS_FQDN_REQUIRED=true
+DNS_BOGUS_PRIV=true
+DNSMASQ_LISTENING=local
+WEBPASSWORD=$(openssl rand -base64 48)
+BLOCKING_ENABLED=true
+EOF
+
+$STD bash <(curl -fsSL https://install.pi-hole.net) /dev/stdin --unattended
+msg_ok "Installed Pi-hole"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/plex-v5-install.sh b/install/plex-v5-install.sh
new file mode 100644
index 00000000..f866c55e
--- /dev/null
+++ b/install/plex-v5-install.sh
@@ -0,0 +1,143 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y gnupg
+msg_ok "Installed Dependencies"
+
+if [[ -z "$(grep -w "100000" /proc/self/uid_map)" ]]; then
+ msg_info "Setting Up Hardware Acceleration"
+ $STD apt-get -y install \
+ va-driver-all \
+ ocl-icd-libopencl1
+ if [[ ${PCT_OSVERSION} == "20.04" ]]; then
+ $STD apt-get install -y beignet-opencl-icd
+ else
+ $STD apt-get install -y intel-opencl-icd
+ fi
+ /bin/chgrp video /dev/dri
+ /bin/chmod 755 /dev/dri
+ /bin/chmod 660 /dev/dri/*
+ msg_ok "Set Up Hardware Acceleration"
+fi
+
+msg_info "Setting Up Plex Media Server Repository"
+$STD apt-key add <(curl -fsSL https://downloads.plex.tv/plex-keys/PlexSign.key)
+sh -c 'echo "deb [arch=$(dpkg --print-architecture)] https://downloads.plex.tv/repo/deb/ public main" > /etc/apt/sources.list.d/plexmediaserver.list'
+msg_ok "Set Up Plex Media Server Repository"
+
+msg_info "Installing Plex Media Server"
+$STD apt-get update
+$STD apt-get -o Dpkg::Options::="--force-confold" install -y plexmediaserver
+msg_ok "Installed Plex Media Server"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/podman-homeassistant-v5-install.sh b/install/podman-homeassistant-v5-install.sh
new file mode 100644
index 00000000..4b594c70
--- /dev/null
+++ b/install/podman-homeassistant-v5-install.sh
@@ -0,0 +1,142 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Podman"
+$STD apt-get -y install podman
+$STD systemctl enable --now podman.socket
+msg_ok "Installed Podman"
+
+msg_info "Pulling Home Assistant Image"
+$STD podman pull docker.io/homeassistant/home-assistant:stable
+msg_ok "Pulled Home Assistant Image"
+
+msg_info "Installing Home Assistant"
+$STD podman volume create hass_config
+$STD podman run -d \
+ --name homeassistant \
+ --restart unless-stopped \
+ -v /dev:/dev \
+ -v hass_config:/config \
+ -v /etc/localtime:/etc/localtime:ro \
+ -v /etc/timezone:/etc/timezone:ro \
+ --net=host \
+ homeassistant/home-assistant:stable
+podman generate systemd \
+ --new --name homeassistant \
+ >/etc/systemd/system/homeassistant.service
+$STD systemctl enable --now homeassistant
+msg_ok "Installed Home Assistant"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/podman-v5-install.sh b/install/podman-v5-install.sh
new file mode 100644
index 00000000..3e2aa3e8
--- /dev/null
+++ b/install/podman-v5-install.sh
@@ -0,0 +1,121 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Podman"
+$STD apt-get -y install podman
+$STD systemctl enable --now podman.socket
+echo -e 'unqualified-search-registries=["docker.io"]' >> /etc/containers/registries.conf
+msg_ok "Installed Podman"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/postgresql-v5-install.sh b/install/postgresql-v5-install.sh
new file mode 100644
index 00000000..6c589a4f
--- /dev/null
+++ b/install/postgresql-v5-install.sh
@@ -0,0 +1,238 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y gnupg
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up PostgreSQL Repository"
+sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
+$STD apt-key add <(curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc)
+msg_ok "Setup PostgreSQL Repository"
+
+msg_info "Installing PostgreSQL"
+$STD apt-get update
+$STD apt-get install -y postgresql
+
+cat </etc/postgresql/15/main/pg_hba.conf
+# PostgreSQL Client Authentication Configuration File
+local all postgres peer
+# TYPE DATABASE USER ADDRESS METHOD
+# "local" is for Unix domain socket connections only
+local all all peer
+# IPv4 local connections:
+host all all 127.0.0.1/32 scram-sha-256
+host all all 0.0.0.0/24 md5
+# IPv6 local connections:
+host all all ::1/128 scram-sha-256
+host all all 0.0.0.0/0 md5
+# Allow replication connections from localhost, by a user with the
+# replication privilege.
+local replication all peer
+host replication all 127.0.0.1/32 scram-sha-256
+host replication all ::1/128 scram-sha-256
+EOF
+
+cat </etc/postgresql/15/main/postgresql.conf
+# -----------------------------
+# PostgreSQL configuration file
+# -----------------------------
+
+#------------------------------------------------------------------------------
+# FILE LOCATIONS
+#------------------------------------------------------------------------------
+
+data_directory = '/var/lib/postgresql/15/main'
+hba_file = '/etc/postgresql/15/main/pg_hba.conf'
+ident_file = '/etc/postgresql/15/main/pg_ident.conf'
+external_pid_file = '/var/run/postgresql/15-main.pid'
+
+#------------------------------------------------------------------------------
+# CONNECTIONS AND AUTHENTICATION
+#------------------------------------------------------------------------------
+
+# - Connection Settings -
+
+listen_addresses = '*'
+port = 5432
+max_connections = 100
+unix_socket_directories = '/var/run/postgresql'
+
+# - SSL -
+
+ssl = on
+ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
+ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'
+
+#------------------------------------------------------------------------------
+# RESOURCE USAGE (except WAL)
+#------------------------------------------------------------------------------
+
+shared_buffers = 128MB
+dynamic_shared_memory_type = posix
+
+#------------------------------------------------------------------------------
+# WRITE-AHEAD LOG
+#------------------------------------------------------------------------------
+
+max_wal_size = 1GB
+min_wal_size = 80MB
+
+#------------------------------------------------------------------------------
+# REPORTING AND LOGGING
+#------------------------------------------------------------------------------
+
+# - What to Log -
+
+log_line_prefix = '%m [%p] %q%u@%d '
+log_timezone = 'Etc/UTC'
+
+#------------------------------------------------------------------------------
+# PROCESS TITLE
+#------------------------------------------------------------------------------
+
+cluster_name = '15/main'
+
+#------------------------------------------------------------------------------
+# CLIENT CONNECTION DEFAULTS
+#------------------------------------------------------------------------------
+
+# - Locale and Formatting -
+
+datestyle = 'iso, mdy'
+timezone = 'Etc/UTC'
+lc_messages = 'C'
+lc_monetary = 'C'
+lc_numeric = 'C'
+lc_time = 'C'
+default_text_search_config = 'pg_catalog.english'
+
+#------------------------------------------------------------------------------
+# CONFIG FILE INCLUDES
+#------------------------------------------------------------------------------
+
+include_dir = 'conf.d'
+EOF
+
+sudo systemctl restart postgresql
+msg_ok "Installed PostgreSQL"
+
+read -r -p "Would you like to add Adminer? " prompt
+if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ msg_info "Installing Adminer"
+ $STD apt install -y adminer
+ $STD sudo a2enconf adminer
+ $STD systemctl reload apache2
+ msg_ok "Installed Adminer"
+fi
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/prometheus-v5-install.sh b/install/prometheus-v5-install.sh
new file mode 100644
index 00000000..7d561256
--- /dev/null
+++ b/install/prometheus-v5-install.sh
@@ -0,0 +1,152 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Prometheus"
+RELEASE=$(curl -s https://api.github.com/repos/prometheus/prometheus/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
+mkdir -p /etc/prometheus
+mkdir -p /var/lib/prometheus
+$STD wget https://github.com/prometheus/prometheus/releases/download/v${RELEASE}/prometheus-${RELEASE}.linux-amd64.tar.gz
+$STD tar -xvf prometheus-${RELEASE}.linux-amd64.tar.gz
+cd prometheus-${RELEASE}.linux-amd64
+mv prometheus promtool /usr/local/bin/
+mv consoles/ console_libraries/ /etc/prometheus/
+mv prometheus.yml /etc/prometheus/prometheus.yml
+msg_ok "Installed Prometheus"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/prometheus.service"
+echo "[Unit]
+Description=Prometheus
+Wants=network-online.target
+After=network-online.target
+
+[Service]
+User=root
+Restart=always
+Type=simple
+ExecStart=/usr/local/bin/prometheus \
+ --config.file=/etc/prometheus/prometheus.yml \
+ --storage.tsdb.path=/var/lib/prometheus/ \
+ --web.console.templates=/etc/prometheus/consoles \
+ --web.console.libraries=/etc/prometheus/console_libraries \
+ --web.listen-address=0.0.0.0:9090
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+$STD sudo systemctl enable --now prometheus
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+rm -rf /root/prometheus-${RELEASE}.linux-amd64 /root/prometheus-${RELEASE}.linux-amd64.tar.gz
+msg_ok "Cleaned"
diff --git a/install/prowlarr-v5-install.sh b/install/prowlarr-v5-install.sh
new file mode 100644
index 00000000..565541ac
--- /dev/null
+++ b/install/prowlarr-v5-install.sh
@@ -0,0 +1,145 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y sqlite3
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Prowlarr"
+mkdir -p /var/lib/prowlarr/
+chmod 775 /var/lib/prowlarr/
+$STD wget --content-disposition 'https://prowlarr.servarr.com/v1/update/master/updatefile?os=linux&runtime=netcore&arch=x64'
+$STD tar -xvzf Prowlarr.master.*.tar.gz
+mv Prowlarr /opt
+chmod 775 /opt/Prowlarr
+msg_ok "Installed Prowlarr"
+
+msg_info "Creating Service"
+cat </etc/systemd/system/prowlarr.service
+[Unit]
+Description=Prowlarr Daemon
+After=syslog.target network.target
+[Service]
+UMask=0002
+Type=simple
+ExecStart=/opt/Prowlarr/Prowlarr -nobrowser -data=/var/lib/prowlarr/
+TimeoutStopSec=20
+KillMode=process
+Restart=on-failure
+[Install]
+WantedBy=multi-user.target
+EOF
+systemctl -q daemon-reload
+systemctl enable --now -q prowlarr
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+rm -rf Prowlarr.master.*.tar.gz
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/qbittorrent-v5-install.sh b/install/qbittorrent-v5-install.sh
new file mode 100644
index 00000000..8ced8627
--- /dev/null
+++ b/install/qbittorrent-v5-install.sh
@@ -0,0 +1,133 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing qbittorrent-nox"
+$STD apt-get install -y qbittorrent-nox
+msg_ok "qbittorrent-nox"
+
+msg_info "Creating Service"
+cat </etc/systemd/system/qbittorrent-nox.service
+[Unit]
+Description=qBittorrent client
+After=network.target
+[Service]
+ExecStart=/usr/bin/qbittorrent-nox --webui-port=8090
+Restart=always
+[Install]
+WantedBy=multi-user.target
+EOF
+systemctl enable -q --now qbittorrent-nox
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/radarr-v5-install.sh b/install/radarr-v5-install.sh
new file mode 100644
index 00000000..655bf395
--- /dev/null
+++ b/install/radarr-v5-install.sh
@@ -0,0 +1,145 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y sqlite3
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Radarr"
+mkdir -p /var/lib/radarr/
+chmod 775 /var/lib/radarr/
+$STD wget --content-disposition 'https://radarr.servarr.com/v1/update/master/updatefile?os=linux&runtime=netcore&arch=x64'
+$STD tar -xvzf Radarr.master.*.tar.gz
+mv Radarr /opt
+chmod 775 /opt/Radarr
+msg_ok "Installed Radarr"
+
+msg_info "Creating Service"
+cat </etc/systemd/system/radarr.service
+[Unit]
+Description=Radarr Daemon
+After=syslog.target network.target
+[Service]
+UMask=0002
+Type=simple
+ExecStart=/opt/Radarr/Radarr -nobrowser -data=/var/lib/radarr/
+TimeoutStopSec=20
+KillMode=process
+Restart=on-failure
+[Install]
+WantedBy=multi-user.target
+EOF
+systemctl -q daemon-reload
+systemctl enable --now -q radarr
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+rm -rf Radarr.master.*.tar.gz
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/readarr-v5-install.sh b/install/readarr-v5-install.sh
new file mode 100644
index 00000000..f2388649
--- /dev/null
+++ b/install/readarr-v5-install.sh
@@ -0,0 +1,145 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y sqlite3
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Readarr"
+mkdir -p /var/lib/readarr/
+chmod 775 /var/lib/readarr/
+$STD wget --content-disposition 'https://readarr.servarr.com/v1/update/develop/updatefile?os=linux&runtime=netcore&arch=x64'
+$STD tar -xvzf Readarr.develop.*.tar.gz
+mv Readarr /opt
+chmod 775 /opt/Readarr
+msg_ok "Installed Readarr"
+
+msg_info "Creating Service"
+cat </etc/systemd/system/readarr.service
+[Unit]
+Description=Readarr Daemon
+After=syslog.target network.target
+[Service]
+UMask=0002
+Type=simple
+ExecStart=/opt/Readarr/Readarr -nobrowser -data=/var/lib/readarr/
+TimeoutStopSec=20
+KillMode=process
+Restart=on-failure
+[Install]
+WantedBy=multi-user.target
+EOF
+systemctl -q daemon-reload
+systemctl enable --now -q readarr
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+rm -rf Readarr.develop.*.tar.gz
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/rstptoweb-v5-install.sh b/install/rstptoweb-v5-install.sh
new file mode 100644
index 00000000..f1c28169
--- /dev/null
+++ b/install/rstptoweb-v5-install.sh
@@ -0,0 +1,148 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y git
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Golang"
+$STD wget https://golang.org/dl/go1.20.1.linux-amd64.tar.gz
+$STD tar -xzf go1.20.1.linux-amd64.tar.gz -C /usr/local
+$STD ln -s /usr/local/go/bin/go /usr/local/bin/go
+rm -rf go1.20.1.linux-amd64.tar.gz
+msg_ok "Installed Golang"
+
+msg_info "Installing RSTPtoWEB"
+$STD git clone https://github.com/deepch/RTSPtoWeb /opt/rtsptoweb
+cat <>/opt/rtsptoweb/start
+#!/bin/bash
+cd /opt/rtsptoweb && GO111MODULE=on go run *.go
+EOF
+chmod +x /opt/rtsptoweb/start
+msg_ok "Installed RSTPtoWEB"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/rtsptoweb.service"
+echo "[Unit]
+Description=RTSP to Web Streaming Service
+After=network.target
+
+[Service]
+Type=simple
+User=root
+ExecStart=/opt/rtsptoweb/start
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+systemctl enable -q --now rtsptoweb
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/sabnzbd-v5-install.sh b/install/sabnzbd-v5-install.sh
new file mode 100644
index 00000000..9d9cb825
--- /dev/null
+++ b/install/sabnzbd-v5-install.sh
@@ -0,0 +1,149 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y unzip
+$STD apt-get install -y par2
+$STD apt-get install -y p7zip-full
+wget -q http://http.us.debian.org/debian/pool/non-free/u/unrar-nonfree/unrar_6.0.3-1+deb11u1_amd64.deb
+$STD dpkg -i unrar_6.0.3-1+deb11u1_amd64.deb
+rm unrar_6.0.3-1+deb11u1_amd64.deb
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Python3-pip"
+$STD apt-get install -y python3-setuptools
+$STD apt-get install -y python3-pip
+msg_ok "Installed Python3-pip"
+
+msg_info "Installing SABnzbd"
+RELEASE=$(curl -s https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
+$STD tar zxvf <(curl -fsSL https://github.com/sabnzbd/sabnzbd/releases/download/$RELEASE/SABnzbd-${RELEASE}-src.tar.gz)
+mv SABnzbd-${RELEASE} /opt/sabnzbd
+cd /opt/sabnzbd
+$STD python3 -m pip install -r requirements.txt
+msg_ok "Installed SABnzbd"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/sabnzbd.service"
+echo "[Unit]
+Description=SABnzbd
+After=network.target
+[Service]
+WorkingDirectory=/opt/sabnzbd
+ExecStart=python3 SABnzbd.py -s 0.0.0.0:7777
+Restart=always
+User=root
+[Install]
+WantedBy=multi-user.target" >$service_path
+systemctl enable --now -q sabnzbd.service
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/scrypted-v5-install.sh b/install/scrypted-v5-install.sh
new file mode 100644
index 00000000..60b1e6e9
--- /dev/null
+++ b/install/scrypted-v5-install.sh
@@ -0,0 +1,203 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get -y install software-properties-common apt-utils
+$STD apt-get -y update
+$STD apt-get -y upgrade
+$STD apt-get -y install \
+ build-essential \
+ gcc \
+ gir1.2-gtk-3.0 \
+ libcairo2-dev \
+ libgirepository1.0-dev \
+ libglib2.0-dev \
+ libjpeg-dev \
+ libgif-dev \
+ libopenjp2-7 \
+ libpango1.0-dev \
+ librsvg2-dev \
+ pkg-config \
+ curl \
+ sudo \
+ mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing GStreamer"
+$STD apt-get -y install \
+ gstreamer1.0-tools \
+ libgstreamer1.0-dev \
+ libgstreamer-plugins-base1.0-dev \
+ libgstreamer-plugins-bad1.0-dev \
+ gstreamer1.0-plugins-base \
+ gstreamer1.0-plugins-good \
+ gstreamer1.0-plugins-bad \
+ gstreamer1.0-plugins-ugly \
+ gstreamer1.0-libav \
+ gstreamer1.0-alsa
+msg_ok "Installed GStreamer"
+
+msg_info "Setting up Node.js Repository"
+$STD bash <(curl -fsSL https://deb.nodesource.com/setup_18.x)
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+$STD apt-get install -y nodejs
+msg_ok "Installed Node.js"
+
+msg_info "Installing Python3"
+$STD apt-get -y install \
+ python3 \
+ python3-dev \
+ python3-gi \
+ python3-gst-1.0 \
+ python3-matplotlib \
+ python3-numpy \
+ python3-opencv \
+ python3-pil \
+ python3-pip \
+ python3-setuptools \
+ python3-skimage \
+ python3-wheel
+$STD python3 -m pip install --upgrade pip
+$STD python3 -m pip install aiofiles debugpy typing_extensions typing
+msg_ok "Installed Python3"
+
+read -r -p "Would you like to add Coral Edge TPU support? " prompt
+if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+msg_info "Adding Coral Edge TPU Support"
+$STD apt-key add <(curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg)
+sh -c 'echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list'
+$STD apt-get -y update
+$STD apt-get -y install libedgetpu1-std
+msg_ok "Coral Edge TPU Support Added"
+fi
+
+msg_info "Installing Scrypted"
+$STD sudo -u root npx -y scrypted@latest install-server
+msg_info "Installed Scrypted"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/scrypted.service"
+echo "[Unit]
+Description=Scrypted service
+After=network.target
+
+[Service]
+User=root
+Group=root
+Type=simple
+ExecStart=/usr/bin/npx -y scrypted serve
+Restart=on-failure
+RestartSec=3
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+$STD systemctl enable --now scrypted.service
+msg_ok "Created Service"
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/shinobi-v5-install.sh b/install/shinobi-v5-install.sh
new file mode 100644
index 00000000..755148af
--- /dev/null
+++ b/install/shinobi-v5-install.sh
@@ -0,0 +1,178 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update --fix-missing
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+ubuntuversion=$(lsb_release -r | awk '{print $2}' | cut -d . -f1)
+if [ "$ubuntuversion" = "18" ] || [ "$ubuntuversion" -le "18" ]; then
+ apt install sudo wget -y
+ sudo apt install -y software-properties-common
+ sudo add-apt-repository universe -y
+ apt update -y
+ apt update --fix-missing -y
+fi
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl sudo git mc
+$STD apt-get install -y make zip net-tools
+$STD apt-get install -y gcc g++ cmake
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up Node.js Repository"
+$STD bash <(curl -fsSL https://deb.nodesource.com/setup_18.x)
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+$STD apt-get install -y nodejs
+msg_ok "Installed Node.js"
+
+msg_info "Installing FFMPEG"
+$STD apt-get install -y ffmpeg
+msg_ok "Installed FFMPEG"
+
+msg_info "Clonning Shinobi"
+cd /opt
+$STD git clone https://gitlab.com/Shinobi-Systems/Shinobi.git -b master Shinobi
+cd Shinobi
+gitVersionNumber=$(git rev-parse HEAD)
+theDateRightNow=$(date)
+touch version.json
+chmod 777 version.json
+echo '{"Product" : "'"Shinobi"'" , "Branch" : "'"master"'" , "Version" : "'"$gitVersionNumber"'" , "Date" : "'"$theDateRightNow"'" , "Repository" : "'"https://gitlab.com/Shinobi-Systems/Shinobi.git"'"}' > version.json
+msg_ok "Cloned Shinobi"
+
+msg_info "Installing Database"
+sqlpass=""
+echo "mariadb-server mariadb-server/root_password password $sqlpass" | debconf-set-selections
+echo "mariadb-server mariadb-server/root_password_again password $sqlpass" | debconf-set-selections
+$STD apt-get install -y mariadb-server
+service mysql start
+sqluser="root"
+mysql -e "source sql/user.sql" || true
+mysql -e "source sql/framework.sql" || true
+msg_ok "Installed Database"
+cp conf.sample.json conf.json
+cronKey=$(head -c 1024 < /dev/urandom | sha256sum | awk '{print substr($1,1,29)}')
+sed -i -e 's/Shinobi/'"$cronKey"'/g' conf.json
+cp super.sample.json super.json
+
+msg_info "Installing Shinobi"
+$STD npm i npm -g
+$STD npm install --unsafe-perm
+$STD npm install pm2@latest -g
+chmod -R 755 .
+touch INSTALL/installed.txt
+ln -s /opt/Shinobi/INSTALL/shinobi /usr/bin/shinobi
+node /opt/Shinobi/tools/modifyConfiguration.js addToConfig="{\"cron\":{\"key\":\"$(head -c 64 < /dev/urandom | sha256sum | awk '{print substr($1,1,60)}')\"}}" &>/dev/null
+$STD pm2 start camera.js
+$STD pm2 start cron.js
+$STD pm2 startup
+$STD pm2 save
+$STD pm2 list
+msg_ok "Installed Shinobi"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/sonarr-v5-install.sh b/install/sonarr-v5-install.sh
new file mode 100644
index 00000000..9ca338dc
--- /dev/null
+++ b/install/sonarr-v5-install.sh
@@ -0,0 +1,125 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+export DEBIAN_FRONTEND=noninteractive
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y gnupg
+$STD apt-get install -y ca-certificates
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Sonarr"
+$STD apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 2009837CBFFD68F45BC180471F4F90DE2A9B4BF8
+sh -c 'echo "deb https://apt.sonarr.tv/debian buster-develop main" > /etc/apt/sources.list.d/sonarr.list'
+$STD apt-get update
+$STD apt-get -o Dpkg::Options::="--force-confold" install -y sonarr
+msg_ok "Installed Sonarr"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/syncthing-v5-install.sh b/install/syncthing-v5-install.sh
new file mode 100644
index 00000000..315a88da
--- /dev/null
+++ b/install/syncthing-v5-install.sh
@@ -0,0 +1,128 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y gnupg
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Syncthing"
+curl -s -o /usr/share/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
+sh -c 'echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" > /etc/apt/sources.list.d/syncthing.list'
+$STD apt-get update
+$STD apt-get install -y syncthing
+$STD systemctl enable syncthing@root.service
+systemctl start syncthing@root.service
+sleep 5
+sed -i "{s/127.0.0.1:8384/0.0.0.0:8384/g}" /root/.config/syncthing/config.xml
+systemctl restart syncthing@root.service
+msg_ok "Installed Syncthing"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/tdarr-v5-install.sh b/install/tdarr-v5-install.sh
new file mode 100644
index 00000000..705a53ce
--- /dev/null
+++ b/install/tdarr-v5-install.sh
@@ -0,0 +1,172 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y unzip
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Tdarr"
+mkdir -p /opt/tdarr
+cd /opt/tdarr
+wget -q https://f000.backblazeb2.com/file/tdarrs/versions/2.00.15/linux_x64/Tdarr_Updater.zip
+$STD unzip Tdarr_Updater.zip
+chmod +x Tdarr_Updater
+$STD ./Tdarr_Updater
+msg_ok "Installed Tdarr"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/tdarr-server.service"
+echo "[Unit]
+Description=Tdarr Server Daemon
+After=network.target
+# Enable if using ZFS, edit and enable if other FS mounting is required to access directory
+#Requires=zfs-mount.service
+
+[Service]
+User=root
+Group=root
+
+Type=simple
+WorkingDirectory=/opt/tdarr/Tdarr_Server
+ExecStartPre=/opt/tdarr/Tdarr_Updater
+ExecStart=/opt/tdarr/Tdarr_Server/Tdarr_Server
+TimeoutStopSec=20
+KillMode=process
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+
+service_path="/etc/systemd/system/tdarr-node.service"
+echo "[Unit]
+Description=Tdarr Node Daemon
+After=network.target
+Requires=tdarr-server.service
+
+[Service]
+User=root
+Group=root
+
+Type=simple
+WorkingDirectory=/opt/tdarr/Tdarr_Node
+ExecStart=/opt/tdarr/Tdarr_Node/Tdarr_Node
+TimeoutStopSec=20
+KillMode=process
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+systemctl enable --now -q tdarr-server.service
+systemctl enable --now -q tdarr-node.service
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+rm -rf Tdarr_Updater.zip
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/technitiumdns-v5-install.sh b/install/technitiumdns-v5-install.sh
new file mode 100644
index 00000000..8570aebc
--- /dev/null
+++ b/install/technitiumdns-v5-install.sh
@@ -0,0 +1,131 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing ASP.NET Core Runtime"
+wget -q https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
+$STD dpkg -i packages-microsoft-prod.deb
+rm -rf packages-microsoft-prod.deb
+$STD apt-get update
+$STD apt-get install -y aspnetcore-runtime-7.0
+msg_ok "Installed ASP.NET Core Runtime"
+
+msg_info "Installing Technitium DNS"
+systemctl stop systemd-resolved
+echo "DNSStubListener=no" >>/etc/systemd/resolved.conf
+ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
+$STD bash <(curl -fsSL https://download.technitium.com/dns/install.sh)
+msg_ok "Installed Technitium DNS"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/transmission-v5-install.sh b/install/transmission-v5-install.sh
new file mode 100644
index 00000000..c2e22764
--- /dev/null
+++ b/install/transmission-v5-install.sh
@@ -0,0 +1,123 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+
+msg_info "Installing Transmission"
+$STD apt-get install -y transmission-daemon
+systemctl stop transmission-daemon
+sed -i '{s/"rpc-whitelist-enabled": true/"rpc-whitelist-enabled": false/g; s/"rpc-host-whitelist-enabled": true,/"rpc-host-whitelist-enabled": false,/g}' /etc/transmission-daemon/settings.json
+systemctl start transmission-daemon
+msg_ok "Installed Transmission"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/trilium-v5-install.sh b/install/trilium-v5-install.sh
new file mode 100644
index 00000000..05a61efa
--- /dev/null
+++ b/install/trilium-v5-install.sh
@@ -0,0 +1,146 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+RELEASE=$(curl -s https://api.github.com/repos/zadam/trilium/releases/latest |
+ grep "tag_name" |
+ awk '{print substr($2, 3, length($2)-4) }')
+
+msg_info "Installing Trilium"
+wget -q https://github.com/zadam/trilium/releases/download/v$RELEASE/trilium-linux-x64-server-$RELEASE.tar.xz
+$STD tar -xvf trilium-linux-x64-server-$RELEASE.tar.xz
+mv trilium-linux-x64-server /opt/trilium
+msg_ok "Installed Trilium"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/trilium.service"
+
+echo "[Unit]
+Description=Trilium Daemon
+After=syslog.target network.target
+
+[Service]
+User=root
+Type=simple
+ExecStart=/opt/trilium/trilium.sh
+WorkingDirectory=/opt/trilium/
+TimeoutStopSec=20
+Restart=always
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+systemctl enable --now -q trilium
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+rm -rf /root/trilium-linux-x64-server-$RELEASE.tar.xz
+msg_ok "Cleaned"
diff --git a/install/ubuntu-v5-install.sh b/install/ubuntu-v5-install.sh
new file mode 100644
index 00000000..9f1409ff
--- /dev/null
+++ b/install/ubuntu-v5-install.sh
@@ -0,0 +1,116 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/umbrel-v5-install.sh b/install/umbrel-v5-install.sh
new file mode 100644
index 00000000..8846aa68
--- /dev/null
+++ b/install/umbrel-v5-install.sh
@@ -0,0 +1,133 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Umbrel (Patience)"
+DOCKER_CONFIG_PATH='/etc/docker/daemon.json'
+mkdir -p $(dirname $DOCKER_CONFIG_PATH)
+if [ "$ST" == "yes" ]; then
+VER=$(curl -s https://api.github.com/repos/containers/fuse-overlayfs/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
+cd /usr/local/bin
+curl -sSL -o fuse-overlayfs https://github.com/containers/fuse-overlayfs/releases/download/$VER/fuse-overlayfs-x86_64
+chmod 755 /usr/local/bin/fuse-overlayfs
+cd ~
+echo -e '{\n "storage-driver": "fuse-overlayfs",\n "log-driver": "journald"\n}' > /etc/docker/daemon.json
+else
+echo -e '{\n "log-driver": "journald"\n}' > /etc/docker/daemon.json
+fi
+$STD bash <(curl -fsSL https://umbrel.sh)
+systemctl daemon-reload
+$STD systemctl enable --now umbrel-startup.service
+msg_ok "Installed Umbrel"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/unifi-v5-install.sh b/install/unifi-v5-install.sh
new file mode 100644
index 00000000..1eaa6cf3
--- /dev/null
+++ b/install/unifi-v5-install.sh
@@ -0,0 +1,129 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+#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
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+read -r -p "Local Controller? " prompt
+if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ LOCAL="--local-controller"
+else
+ LOCAL=""
+fi
+
+msg_info "Installing UniFi Network Application (Patience)"
+wget -qL https://get.glennr.nl/unifi/install/install_latest/unifi-latest.sh
+$STD bash unifi-latest.sh --skip --add-repository $LOCAL
+msg_ok "Installed UniFi Network Application"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/uptimekuma-v5-install.sh b/install/uptimekuma-v5-install.sh
new file mode 100644
index 00000000..d9c8284b
--- /dev/null
+++ b/install/uptimekuma-v5-install.sh
@@ -0,0 +1,149 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y git
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up Node.js Repository"
+$STD bash <(curl -fsSL https://deb.nodesource.com/setup_18.x)
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+$STD sudo apt-get install -y nodejs
+msg_ok "Installed Node.js"
+
+msg_info "Installing Uptime Kuma"
+$STD git clone https://github.com/louislam/uptime-kuma.git
+mv uptime-kuma /opt/uptime-kuma
+cd /opt/uptime-kuma
+$STD npm run setup
+msg_ok "Installed Uptime Kuma"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/uptime-kuma.service"
+echo "[Unit]
+Description=uptime-kuma
+
+[Service]
+Type=simple
+Restart=always
+User=root
+WorkingDirectory=/opt/uptime-kuma
+ExecStart=/usr/bin/npm start
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+$STD systemctl enable --now uptime-kuma.service
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/vaultwarden-v5-install.sh b/install/vaultwarden-v5-install.sh
new file mode 100644
index 00000000..c1d63e1f
--- /dev/null
+++ b/install/vaultwarden-v5-install.sh
@@ -0,0 +1,206 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get update
+$STD apt-get -qqy install \
+ git \
+ build-essential \
+ pkgconf \
+ libssl-dev \
+ libmariadb-dev-compat \
+ libpq-dev \
+ curl \
+ sudo \
+ mc
+msg_ok "Installed Dependencies"
+
+WEBVAULT=$(curl -s https://api.github.com/repos/dani-garcia/bw_web_builds/releases/latest |
+ grep "tag_name" |
+ awk '{print substr($2, 2, length($2)-3) }')
+
+VAULT=$(curl -s https://api.github.com/repos/dani-garcia/vaultwarden/releases/latest |
+ grep "tag_name" |
+ awk '{print substr($2, 2, length($2)-3) }')
+
+msg_info "Installing Rust"
+wget -qL https://sh.rustup.rs
+$STD bash index.html -y --profile minimal
+echo 'export PATH=~/.cargo/bin:$PATH' >>~/.bashrc
+export PATH=~/.cargo/bin:$PATH
+rm index.html
+msg_ok "Installed Rust"
+
+msg_info "Building Vaultwarden ${VAULT} (Patience)"
+$STD git clone https://github.com/dani-garcia/vaultwarden
+cd vaultwarden
+$STD cargo build --features "sqlite,mysql,postgresql" --release
+msg_ok "Built Vaultwarden ${VAULT}"
+
+$STD addgroup --system vaultwarden
+$STD adduser --system --home /opt/vaultwarden --shell /usr/sbin/nologin --no-create-home --gecos 'vaultwarden' --ingroup vaultwarden --disabled-login --disabled-password vaultwarden
+mkdir -p /opt/vaultwarden/bin
+mkdir -p /opt/vaultwarden/data
+cp target/release/vaultwarden /opt/vaultwarden/bin/
+
+msg_info "Downloading Web-Vault ${WEBVAULT}"
+$STD curl -fsSLO https://github.com/dani-garcia/bw_web_builds/releases/download/$WEBVAULT/bw_web_$WEBVAULT.tar.gz
+$STD tar -xzf bw_web_$WEBVAULT.tar.gz -C /opt/vaultwarden/
+msg_ok "Downloaded Web-Vault ${WEBVAULT}"
+
+cat </opt/vaultwarden/.env
+ADMIN_TOKEN=$(openssl rand -base64 48)
+ROCKET_ADDRESS=0.0.0.0
+DATA_FOLDER=/opt/vaultwarden/data
+DATABASE_MAX_CONNS=10
+WEB_VAULT_FOLDER=/opt/vaultwarden/web-vault
+WEB_VAULT_ENABLED=true
+EOF
+
+msg_info "Creating Service"
+chown -R vaultwarden:vaultwarden /opt/vaultwarden/
+chown root:root /opt/vaultwarden/bin/vaultwarden
+chmod +x /opt/vaultwarden/bin/vaultwarden
+chown -R root:root /opt/vaultwarden/web-vault/
+chmod +r /opt/vaultwarden/.env
+
+service_path="/etc/systemd/system/vaultwarden.service"
+echo "[Unit]
+Description=Bitwarden Server (Powered by Vaultwarden)
+Documentation=https://github.com/dani-garcia/vaultwarden
+After=network.target
+[Service]
+User=vaultwarden
+Group=vaultwarden
+EnvironmentFile=-/opt/vaultwarden/.env
+ExecStart=/opt/vaultwarden/bin/vaultwarden
+LimitNOFILE=65535
+LimitNPROC=4096
+PrivateTmp=true
+PrivateDevices=true
+ProtectHome=true
+ProtectSystem=strict
+DevicePolicy=closed
+ProtectControlGroups=yes
+ProtectKernelModules=yes
+ProtectKernelTunables=yes
+RestrictNamespaces=yes
+RestrictRealtime=yes
+MemoryDenyWriteExecute=yes
+LockPersonality=yes
+WorkingDirectory=/opt/vaultwarden
+ReadWriteDirectories=/opt/vaultwarden/data
+AmbientCapabilities=CAP_NET_BIND_SERVICE
+[Install]
+WantedBy=multi-user.target" >$service_path
+systemctl daemon-reload
+$STD systemctl enable --now vaultwarden.service
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/whisparr-v5-install.sh b/install/whisparr-v5-install.sh
new file mode 100644
index 00000000..82d4dce7
--- /dev/null
+++ b/install/whisparr-v5-install.sh
@@ -0,0 +1,145 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS"
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y sqlite3
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Whisparr"
+mkdir -p /var/lib/whisparr/
+chmod 775 /var/lib/whisparr/
+$STD wget --content-disposition 'https://whisparr.servarr.com/v1/update/nightly/updatefile?os=linux&runtime=netcore&arch=x64'
+$STD tar -xvzf Whisparr.develop.*.tar.gz
+mv Whisparr /opt
+chmod 775 /opt/Whisparr
+msg_ok "Installed Whisparr"
+
+msg_info "Creating Service"
+cat </etc/systemd/system/whisparr.service
+[Unit]
+Description=whisparr Daemon
+After=syslog.target network.target
+[Service]
+UMask=0002
+Type=simple
+ExecStart=/opt/Whisparr/Whisparr -nobrowser -data=/var/lib/whisparr/
+TimeoutStopSec=20
+KillMode=process
+Restart=on-failure
+[Install]
+WantedBy=multi-user.target
+EOF
+systemctl -q daemon-reload
+systemctl enable --now -q whisparr
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+rm -rf Whisparr.develop.*.tar.gz
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/whoogle-v5-install.sh b/install/whoogle-v5-install.sh
new file mode 100644
index 00000000..816a32df
--- /dev/null
+++ b/install/whoogle-v5-install.sh
@@ -0,0 +1,138 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+msg_ok "Installed Dependencies"
+
+msg_info "Installing Python3-pip"
+$STD apt-get install -y python3-pip
+msg_ok "Installed Python3-pip"
+
+msg_info "Installing Whoogle"
+$STD pip install brotli
+$STD pip install whoogle-search
+
+service_path="/etc/systemd/system/whoogle.service"
+echo "[Unit]
+Description=Whoogle-Search
+After=network.target
+[Service]
+ExecStart=/usr/local/bin/whoogle-search --host 0.0.0.0
+Restart=always
+User=root
+[Install]
+WantedBy=multi-user.target" >$service_path
+
+$STD systemctl enable --now whoogle.service
+msg_ok "Installed Whoogle"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <$GETTY_OVERRIDE
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
+EOF
+ systemctl daemon-reload
+ systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
+ msg_ok "Customized Container"
+fi
+if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
+
+msg_info "Cleaning up"
+$STD apt-get autoremove
+$STD apt-get autoclean
+msg_ok "Cleaned"
diff --git a/install/wikijs-v5-install.sh b/install/wikijs-v5-install.sh
new file mode 100644
index 00000000..71a6e946
--- /dev/null
+++ b/install/wikijs-v5-install.sh
@@ -0,0 +1,166 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021-2023 tteck
+# Author: tteck (tteckster)
+# License: MIT
+# https://github.com/tteck/Proxmox/raw/main/LICENSE
+
+if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
+silent() { "$@" > /dev/null 2>&1; }
+if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
+YW=$(echo "\033[33m")
+RD=$(echo "\033[01;31m")
+BL=$(echo "\033[36m")
+GN=$(echo "\033[1;92m")
+CL=$(echo "\033[m")
+RETRY_NUM=10
+RETRY_EVERY=3
+CM="${GN}✓${CL}"
+CROSS="${RD}✗${CL}"
+BFR="\\r\\033[K"
+HOLD="-"
+set -Eeuo pipefail
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+function error_handler() {
+ local exit_code="$?"
+ local line_number="$1"
+ local command="$2"
+ local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
+ echo -e "\n$error_message\n"
+}
+
+function msg_info() {
+ local msg="$1"
+ echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+ local msg="$1"
+ echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
+function msg_error() {
+ local msg="$1"
+ echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
+}
+
+msg_info "Setting up Container OS "
+sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
+locale-gen >/dev/null
+echo $tz > /etc/timezone
+ln -sf /usr/share/zoneinfo/$tz /etc/localtime
+for ((i=RETRY_NUM; i>0; i--)); do
+ if [ "$(hostname -I)" != "" ]; then
+ break
+ fi
+ echo 1>&2 -en "${CROSS}${RD} No Network! "
+ sleep $RETRY_EVERY
+done
+if [ "$(hostname -I)" = "" ]; then
+ echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+fi
+msg_ok "Set up Container OS"
+msg_ok "Network Connected: ${BL}$(hostname -I)"
+
+set +e
+trap - ERR
+if ping -c 1 -W 1 1.1.1.1 &> /dev/null; then msg_ok "Internet Connected"; else
+ msg_error "Internet NOT Connected"
+ read -r -p "Would you like to continue anyway? " prompt
+ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
+ echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
+ else
+ echo -e " 🖧 Check Network Settings"
+ exit 1
+ fi
+fi
+RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
+if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
+set -e
+trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
+
+msg_info "Updating Container OS"
+$STD apt-get update
+$STD apt-get -y upgrade
+msg_ok "Updated Container OS"
+
+msg_info "Installing Dependencies"
+$STD apt-get install -y curl
+$STD apt-get install -y sudo
+$STD apt-get install -y mc
+$STD apt-get install -y git
+msg_ok "Installed Dependencies"
+
+msg_info "Setting up Node.js Repository"
+$STD bash <(curl -fsSL https://deb.nodesource.com/setup_16.x)
+msg_ok "Set up Node.js Repository"
+
+msg_info "Installing Node.js"
+$STD apt-get install -y nodejs
+msg_ok "Installed Node.js"
+
+msg_info "Installing Wiki.js"
+mkdir -p /opt/wikijs
+cd /opt/wikijs
+$STD wget https://github.com/Requarks/wiki/releases/latest/download/wiki-js.tar.gz
+tar xzf wiki-js.tar.gz
+rm wiki-js.tar.gz
+
+cat </opt/wikijs/config.yml
+bindIP: 0.0.0.0
+port: 3000
+db:
+ type: sqlite
+ storage: /opt/wikijs/db.sqlite
+logLevel: info
+logFormat: default
+dataPath: /opt/wikijs/data
+bodyParserLimit: 5mb
+EOF
+$STD npm rebuild sqlite3
+msg_ok "Installed Wiki.js"
+
+msg_info "Creating Service"
+service_path="/etc/systemd/system/wikijs.service"
+
+echo "[Unit]
+Description=Wiki.js
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/node server
+Restart=always
+User=root
+Environment=NODE_ENV=production
+WorkingDirectory=/opt/wikijs
+
+[Install]
+WantedBy=multi-user.target" >$service_path
+$STD systemctl enable --now wikijs
+msg_ok "Created Service"
+
+echo "export TERM='xterm-256color'" >>/root/.bashrc
+echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
+chmod -x /etc/update-motd.d/*
+if ! getent shadow root | grep -q "^root:[^\!*]"; then
+ msg_info "Customizing Container"
+ GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
+ mkdir -p $(dirname $GETTY_OVERRIDE)
+ cat <