mirror of https://github.com/tteck/Proxmox.git
Compare commits
6 Commits
eeafae190c
...
eea752fa79
Author | SHA1 | Date |
---|---|---|
|
eea752fa79 | |
|
214e0d13d5 | |
|
e8bd1c21a0 | |
|
5405f4dc9d | |
|
bda2ff4154 | |
|
2139f9b9db |
|
@ -2,6 +2,13 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## 2023-05-01
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- **OctoPrint LXC**
|
||||||
|
- NEW Script
|
||||||
|
|
||||||
## 2023-04-30
|
## 2023-04-30
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -0,0 +1,78 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func)
|
||||||
|
# Copyright (c) 2021-2023 tteck
|
||||||
|
# Author: tteck (tteckster)
|
||||||
|
# License: MIT
|
||||||
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
||||||
|
|
||||||
|
function header_info {
|
||||||
|
clear
|
||||||
|
cat <<"EOF"
|
||||||
|
____ __ ____ _ __
|
||||||
|
/ __ \_____/ /_____ / __ \_____(_)___ / /_
|
||||||
|
/ / / / ___/ __/ __ \/ /_/ / ___/ / __ \/ __/
|
||||||
|
/ /_/ / /__/ /_/ /_/ / ____/ / / / / / / /_
|
||||||
|
\____/\___/\__/\____/_/ /_/ /_/_/ /_/\__/
|
||||||
|
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
header_info
|
||||||
|
echo -e "Loading..."
|
||||||
|
APP="OctoPrint"
|
||||||
|
var_disk="4"
|
||||||
|
var_cpu="1"
|
||||||
|
var_ram="1024"
|
||||||
|
var_os="debian"
|
||||||
|
var_version="11"
|
||||||
|
variables
|
||||||
|
color
|
||||||
|
catch_errors
|
||||||
|
|
||||||
|
function default_settings() {
|
||||||
|
CT_TYPE="0"
|
||||||
|
PW=""
|
||||||
|
CT_ID=$NEXTID
|
||||||
|
HN=$NSAPP
|
||||||
|
DISK_SIZE="$var_disk"
|
||||||
|
CORE_COUNT="$var_cpu"
|
||||||
|
RAM_SIZE="$var_ram"
|
||||||
|
BRG="vmbr0"
|
||||||
|
NET=dhcp
|
||||||
|
GATE=""
|
||||||
|
DISABLEIP6="no"
|
||||||
|
MTU=""
|
||||||
|
SD=""
|
||||||
|
NS=""
|
||||||
|
MAC=""
|
||||||
|
VLAN=""
|
||||||
|
SSH="no"
|
||||||
|
VERB="no"
|
||||||
|
echo_default
|
||||||
|
}
|
||||||
|
|
||||||
|
function update_script() {
|
||||||
|
header_info
|
||||||
|
if [[ ! -d /opt/octoprint ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||||
|
msg_info "Stopping OctoPrint"
|
||||||
|
systemctl stop octoprint
|
||||||
|
msg_ok "Stopped OctoPrint"
|
||||||
|
|
||||||
|
msg_info "Updating OctoPrint"
|
||||||
|
source /opt/octoprint/bin/activate
|
||||||
|
pip3 install octoprint --upgrade &>/dev/null
|
||||||
|
msg_ok "Updated OctoPrint"
|
||||||
|
|
||||||
|
msg_info "Starting OctoPrint"
|
||||||
|
systemctl start octoprint
|
||||||
|
msg_ok "Started OctoPrint"
|
||||||
|
msg_ok "Updated Successfully"
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
start
|
||||||
|
build_container
|
||||||
|
description
|
||||||
|
|
||||||
|
msg_ok "Completed Successfully!\n"
|
||||||
|
echo -e "${APP} should be reachable by going to the following URL.
|
||||||
|
${BL}http://${IP}:5000${CL} \n"
|
|
@ -0,0 +1,76 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Copyright (c) 2021-2023 tteck
|
||||||
|
# Author: tteck (tteckster)
|
||||||
|
# License: MIT
|
||||||
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
||||||
|
|
||||||
|
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
|
||||||
|
color
|
||||||
|
verb_ip6
|
||||||
|
catch_errors
|
||||||
|
setting_up_container
|
||||||
|
network_check
|
||||||
|
update_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 libyaml-dev
|
||||||
|
$STD apt-get install -y build-essential
|
||||||
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
|
msg_info "Installing Python3"
|
||||||
|
$STD apt-get install -y \
|
||||||
|
python3-pip \
|
||||||
|
python3-dev \
|
||||||
|
python3-setuptools \
|
||||||
|
python3-venv
|
||||||
|
msg_ok "Installed Python3"
|
||||||
|
|
||||||
|
msg_info "Creating user octoprint"
|
||||||
|
useradd -m -s /bin/bash -p $(openssl passwd -1 octoprint) octoprint
|
||||||
|
usermod -aG sudo,tty,dialout octoprint
|
||||||
|
chown -R octoprint:octoprint /opt
|
||||||
|
msg_ok "Created user octoprint"
|
||||||
|
|
||||||
|
msg_info "Installing OctoPrint"
|
||||||
|
$STD sudo -u octoprint bash << EOF
|
||||||
|
mkdir /opt/octoprint
|
||||||
|
cd /opt/octoprint
|
||||||
|
python3 -m venv .
|
||||||
|
source bin/activate
|
||||||
|
pip install --upgrade pip
|
||||||
|
pip install octoprint
|
||||||
|
EOF
|
||||||
|
msg_ok "Installed OctoPrint"
|
||||||
|
|
||||||
|
msg_info "Creating Service"
|
||||||
|
cat <<EOF >/etc/systemd/system/octoprint.service
|
||||||
|
[Unit]
|
||||||
|
Description=The snappy web interface for your 3D printer
|
||||||
|
After=network-online.target
|
||||||
|
Wants=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Environment="LC_ALL=C.UTF-8"
|
||||||
|
Environment="LANG=C.UTF-8"
|
||||||
|
Type=exec
|
||||||
|
User=octoprint
|
||||||
|
ExecStart=/opt/octoprint/bin/octoprint serve
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
systemctl enable -q --now octoprint.service
|
||||||
|
msg_ok "Created Service"
|
||||||
|
|
||||||
|
motd_ssh
|
||||||
|
root
|
||||||
|
|
||||||
|
msg_info "Cleaning up"
|
||||||
|
$STD apt-get autoremove
|
||||||
|
$STD apt-get autoclean
|
||||||
|
msg_ok "Cleaned"
|
|
@ -0,0 +1,63 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# Copyright (c) 2021-2023 tteck
|
||||||
|
# Author: tteck (tteckster)
|
||||||
|
# License: MIT
|
||||||
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
||||||
|
|
||||||
|
clear
|
||||||
|
while true; do
|
||||||
|
read -p "Install the latest Intel Processor Microcode (y/n)?" yn
|
||||||
|
case $yn in
|
||||||
|
[Yy]*) break ;;
|
||||||
|
[Nn]*) exit ;;
|
||||||
|
*) echo "Please answer yes or no." ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
clear
|
||||||
|
cat <<"EOF"
|
||||||
|
____ __ __ __ ____ __
|
||||||
|
/ _/___ / /____ / / / |/ (_)_____________ _________ ____/ /__
|
||||||
|
/ // __ \/ __/ _ \/ / / /|_/ / / ___/ ___/ __ \/ ___/ __ \/ __ / _ \
|
||||||
|
_/ // / / / /_/ __/ / / / / / / /__/ / / /_/ / /__/ /_/ / /_/ / __/
|
||||||
|
/___/_/ /_/\__/\___/_/ /_/ /_/_/\___/_/ \____/\___/\____/\__,_/\___/
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
YW=$(echo "\033[33m")
|
||||||
|
GN=$(echo "\033[1;92m")
|
||||||
|
CL=$(echo "\033[m")
|
||||||
|
BFR="\\r\\033[K"
|
||||||
|
HOLD="-"
|
||||||
|
CM="${GN}✓${CL}"
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
shopt -s inherit_errexit nullglob
|
||||||
|
|
||||||
|
msg_info() {
|
||||||
|
local msg="$1"
|
||||||
|
echo -ne " ${HOLD} ${YW}${msg}..."
|
||||||
|
}
|
||||||
|
|
||||||
|
msg_ok() {
|
||||||
|
local msg="$1"
|
||||||
|
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||||
|
}
|
||||||
|
|
||||||
|
msg_info "Installing iucode-tool: a tool for updating Intel processor microcode"
|
||||||
|
apt-get install -y iucode-tool &>/dev/null
|
||||||
|
msg_ok "Installed iucode-tool"
|
||||||
|
|
||||||
|
msg_info "Downloading the latest Intel Processor Microcode Package for Linux"
|
||||||
|
release=$(curl -s https://api.github.com/repos/intel/Intel-Linux-Processor-Microcode-Data-Files/releases/latest | awk -F'"' '/tag_name/{print $4}' | tr -cd '[:digit:]')
|
||||||
|
wget -q http://ftp.debian.org/debian/pool/non-free-firmware/i/intel-microcode/intel-microcode_3.${release}.1_amd64.deb
|
||||||
|
msg_ok "Downloaded the latest Intel Processor Microcode Package"
|
||||||
|
|
||||||
|
msg_info "Installing the Intel Processor Microcode (Patience)"
|
||||||
|
dpkg -i intel-microcode_3.${release}.1_amd64.deb &>/dev/null
|
||||||
|
msg_ok "Installed the Intel Processor Microcode"
|
||||||
|
|
||||||
|
msg_info "Cleaning up"
|
||||||
|
rm intel-microcode_3.${release}.1_amd64.deb
|
||||||
|
msg_ok "Cleaned"
|
||||||
|
|
||||||
|
echo -e "\n To apply the settings, the system will need to be rebooted.\n"
|
Loading…
Reference in New Issue