Use curl instead of wget

This commit is contained in:
CanbiZ 2025-03-24 12:00:56 +01:00
parent 6c199a2307
commit 9d0b930db8
36 changed files with 2074 additions and 2078 deletions

View File

@ -7,7 +7,7 @@ on:
permissions: permissions:
issues: write issues: write
jobs: jobs:
post_to_discord: post_to_discord:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -24,15 +24,15 @@ jobs:
run: | run: |
REPO="community-scripts/ProxmoxVED" REPO="community-scripts/ProxmoxVED"
API_URL="https://api.github.com/repos/$REPO/contents" API_URL="https://api.github.com/repos/$REPO/contents"
FILES=( FILES=(
"ct/${{ env.TITLE }}.sh" "ct/${{ env.TITLE }}.sh"
"install/${{ env.TITLE }}-install.sh" "install/${{ env.TITLE }}-install.sh"
"frontend/public/json/${{ env.TITLE }}.json" "frontend/public/json/${{ env.TITLE }}.json"
) )
EXISTING_FILES=() EXISTING_FILES=()
for FILE in "${FILES[@]}"; do for FILE in "${FILES[@]}"; do
STATUS=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: token $GH_TOKEN" "$API_URL/$FILE") STATUS=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: token $GH_TOKEN" "$API_URL/$FILE")
if [ "$STATUS" -eq 200 ]; then if [ "$STATUS" -eq 200 ]; then
@ -48,26 +48,26 @@ jobs:
id: create_message id: create_message
run: | run: |
VAR="The ${{ env.TITLE }} script is ready for testing:\n" VAR="The ${{ env.TITLE }} script is ready for testing:\n"
VAR+="\`\`\`bash -c \"\$(wget -qLO - https://github.com/community-scripts/ProxmoxVED/raw/main/ct/${{ env.TITLE }}.sh)\"\`\`\`\n" VAR+="\`\`\`bash -c \"\$(curl -fsSL - https://github.com/community-scripts/ProxmoxVED/raw/main/ct/${{ env.TITLE }}.sh)\"\`\`\`\n"
if [[ " ${EXISTING_FILES[@]} " =~ " frontend/public/json/${TITLE}.json " ]]; then if [[ " ${EXISTING_FILES[@]} " =~ " frontend/public/json/${TITLE}.json " ]]; then
JSON=$(wget -qLO - https://github.com/community-scripts/ProxmoxVED/raw/main/frontend/public/json/${{ env.TITLE }}.json) JSON=$(curl -fsSL - https://github.com/community-scripts/ProxmoxVED/raw/main/frontend/public/json/${{ env.TITLE }}.json)
username=$(echo "$JSON" | jq -r '.default_credentials.username') username=$(echo "$JSON" | jq -r '.default_credentials.username')
password=$(echo "$JSON" | jq -r '.default_credentials.password') password=$(echo "$JSON" | jq -r '.default_credentials.password')
mapfile -t notes_array < <(echo "$JSON" | jq -r '.notes[].text') mapfile -t notes_array < <(echo "$JSON" | jq -r '.notes[].text')
if [[ -n "$username" && "$username" != "null" || -n "$password" && "$password" != "null" ]]; then if [[ -n "$username" && "$username" != "null" || -n "$password" && "$password" != "null" ]]; then
VAR+="Default credentials:\n" VAR+="Default credentials:\n"
if [[ -n "$username" && "$username" != "null" ]]; then if [[ -n "$username" && "$username" != "null" ]]; then
VAR+="Username: $username\n" VAR+="Username: $username\n"
fi fi
if [[ -n "$password" && "$password" != "null" ]]; then if [[ -n "$password" && "$password" != "null" ]]; then
VAR+="Password: $password\n" VAR+="Password: $password\n"
fi fi
VAR+="\n" VAR+="\n"
fi fi
if [ ${#notes_array[@]} -gt 0 ]; then if [ ${#notes_array[@]} -gt 0 ]; then
for note in "${notes_array[@]}"; do for note in "${notes_array[@]}"; do
VAR+="$note\n" VAR+="$note\n"
@ -79,7 +79,7 @@ jobs:
VAR+="Discussion & issue tracking:\n" VAR+="Discussion & issue tracking:\n"
VAR+="${{ github.event.issue.html_url }}" VAR+="${{ github.event.issue.html_url }}"
echo "message=$VAR" >> $GITHUB_ENV echo "message=$VAR" >> $GITHUB_ENV
- name: Create a forumpost in Discord - name: Create a forumpost in Discord
id: post_to_discord id: post_to_discord
env: env:
@ -90,12 +90,12 @@ jobs:
run: | run: |
JSON_PAYLOAD=$(jq -n --arg name "Wanted Tester for $TITLE" --arg content "$MESSAGE" '{name: $name, message: {content: $content | gsub("\\\\n"; "\n")}, applied_tags: []}') JSON_PAYLOAD=$(jq -n --arg name "Wanted Tester for $TITLE" --arg content "$MESSAGE" '{name: $name, message: {content: $content | gsub("\\\\n"; "\n")}, applied_tags: []}')
echo "JSON Payload: $JSON_PAYLOAD" echo "JSON Payload: $JSON_PAYLOAD"
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "https://discord.com/api/v10/channels/$DISCORD_CHANNEL_ID/threads" \ RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "https://discord.com/api/v10/channels/$DISCORD_CHANNEL_ID/threads" \
-H "Authorization: Bot $DISCORD_BOT_TOKEN" \ -H "Authorization: Bot $DISCORD_BOT_TOKEN" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "$JSON_PAYLOAD") -d "$JSON_PAYLOAD")
STATUS_CODE=$(echo "$RESPONSE" | tail -n 1) STATUS_CODE=$(echo "$RESPONSE" | tail -n 1)
if [ "$STATUS_CODE" -eq 201 ]; then if [ "$STATUS_CODE" -eq 201 ]; then
echo "Discord post created successfully!" echo "Discord post created successfully!"
@ -104,7 +104,7 @@ jobs:
echo "Failed to create Discord post! Status code: $STATUS_CODE" echo "Failed to create Discord post! Status code: $STATUS_CODE"
exit 1 exit 1
fi fi
- name: Comment on Issue - name: Comment on Issue
id: comment_on_issue id: comment_on_issue
env: env:

View File

@ -184,7 +184,7 @@ build_container() {
echo "Container ID: $CTID" echo "Container ID: $CTID"
# This executes create_lxc.sh and creates the container and .conf file # This executes create_lxc.sh and creates the container and .conf file
bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/.github/workflows/scripts/app-test/pr-create-lxc.sh)" bash -c "$(curl -fsSL - https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/.github/workflows/scripts/app-test/pr-create-lxc.sh)"
LXC_CONFIG=/etc/pve/lxc/${CTID}.conf LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
if [ "$CT_TYPE" == "0" ]; then if [ "$CT_TYPE" == "0" ]; then
@ -257,4 +257,4 @@ EOF'
description() { description() {
IP=$(pct exec "$CTID" ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1) IP=$(pct exec "$CTID" ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
} }

View File

@ -20,46 +20,46 @@ color
catch_errors catch_errors
function update_script() { function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -d /opt/documenso ]]; then if [[ ! -d /opt/documenso ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -s https://api.github.com/repos/documenso/documenso/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "SET RESOURCES" "Please set the resources in your ${APP} LXC to ${var_cpu}vCPU and ${var_ram}RAM for the build process before continuing" 10 75
msg_info "Stopping ${APP}"
systemctl stop documenso
msg_ok "${APP} Stopped"
msg_info "Updating ${APP} to ${RELEASE}"
cp /opt/documenso/.env /opt/
rm -R /opt/documenso
wget -q "https://github.com/documenso/documenso/archive/refs/tags/v${RELEASE}.zip"
unzip -q v${RELEASE}.zip
mv documenso-${RELEASE} /opt/documenso
cd /opt/documenso
mv /opt/.env /opt/documenso/.env
npm install &>/dev/null
npm run build:web &>/dev/null
npm run prisma:migrate-deploy &>/dev/null
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP}"
msg_info "Starting ${APP}"
systemctl start documenso
msg_ok "Started ${APP}"
msg_info "Cleaning Up"
rm -rf v${RELEASE}.zip
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit exit
fi
RELEASE=$(curl -s https://api.github.com/repos/documenso/documenso/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "SET RESOURCES" "Please set the resources in your ${APP} LXC to ${var_cpu}vCPU and ${var_ram}RAM for the build process before continuing" 10 75
msg_info "Stopping ${APP}"
systemctl stop documenso
msg_ok "${APP} Stopped"
msg_info "Updating ${APP} to ${RELEASE}"
cp /opt/documenso/.env /opt/
rm -R /opt/documenso
curl -fsSL "https://github.com/documenso/documenso/archive/refs/tags/v${RELEASE}.zip"
unzip -q v${RELEASE}.zip
mv documenso-${RELEASE} /opt/documenso
cd /opt/documenso
mv /opt/.env /opt/documenso/.env
npm install &>/dev/null
npm run build:web &>/dev/null
npm run prisma:migrate-deploy &>/dev/null
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP}"
msg_info "Starting ${APP}"
systemctl start documenso
msg_ok "Started ${APP}"
msg_info "Cleaning Up"
rm -rf v${RELEASE}.zip
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
} }
start start

View File

@ -21,46 +21,46 @@ color
catch_errors catch_errors
function update_script() { function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -d /opt/hoodik ]]; then if [[ ! -d /opt/hoodik ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -s https://api.github.com/repos/hudikhq/hoodik/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping Services"
systemctl stop hoodik
msg_ok "Services Stopped"
msg_info "Updating ${APP} to ${RELEASE}"
cd /opt
if [ -d hoodik_bak ]; then
rm -rf hoodik_bak
fi
mv hoodik hoodik_bak
wget -q "https://github.com/hudikhq/hoodik/archive/refs/tags/${RELEASE}.zip"
unzip -q ${RELEASE}.zip
mv hoodik-${RELEASE} /opt/hoodik
cd /opt/hoodik
cargo update -q
cargo build -q --release
msg_ok "Updated Hoodik"
msg_info "Starting Services"
systemctl start hoodik
msg_ok "Started Services"
msg_info "Cleaning Up"
rm -R /opt/${RELEASE}.zip
rm -R /opt/hoodik_bak
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit exit
fi
RELEASE=$(curl -s https://api.github.com/repos/hudikhq/hoodik/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping Services"
systemctl stop hoodik
msg_ok "Services Stopped"
msg_info "Updating ${APP} to ${RELEASE}"
cd /opt
if [ -d hoodik_bak ]; then
rm -rf hoodik_bak
fi
mv hoodik hoodik_bak
curl -fsSL "https://github.com/hudikhq/hoodik/archive/refs/tags/${RELEASE}.zip"
unzip -q ${RELEASE}.zip
mv hoodik-${RELEASE} /opt/hoodik
cd /opt/hoodik
cargo update -q
cargo build -q --release
msg_ok "Updated Hoodik"
msg_info "Starting Services"
systemctl start hoodik
msg_ok "Started Services"
msg_info "Cleaning Up"
rm -R /opt/${RELEASE}.zip
rm -R /opt/hoodik_bak
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
} }
start start

View File

@ -24,45 +24,45 @@ color
catch_errors catch_errors
function update_script() { function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -d /opt/koel ]]; then if [[ ! -d /opt/koel ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -s https://api.github.com/repos/koel/koel/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping ${APP} Service"
systemctl stop nginx
msg_ok "Stopped ${APP} Service"
msg_info "Updating ${APP} to v${RELEASE}"
cd /opt
wget -q https://github.com/koel/koel/releases/download/${RELEASE}/koel-${RELEASE}.zip
unzip -q koel-${RELEASE}.zip
cd /opt/koel
composer update --no-interaction >/dev/null 2>&1
composer install --no-interaction >/dev/null 2>&1
php artisan migrate --force >/dev/null 2>&1
php artisan cache:clear >/dev/null 2>&1
php artisan config:clear >/dev/null 2>&1
php artisan view:clear >/dev/null 2>&1
php artisan koel:init --no-interaction >/dev/null 2>&1
msg_ok "Updated ${APP} to v${RELEASE}"
msg_info "Starting ${APP} Service"
systemctl start nginx
msg_ok "Started ${APP} Service"
msg_info "Cleaning up"
rm -rf /opt/koel-${RELEASE}.zip
msg_ok "Cleaned"
msg_ok "Updated Successfully!\n"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit exit
fi
RELEASE=$(curl -s https://api.github.com/repos/koel/koel/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping ${APP} Service"
systemctl stop nginx
msg_ok "Stopped ${APP} Service"
msg_info "Updating ${APP} to v${RELEASE}"
cd /opt
curl -fsSL https://github.com/koel/koel/releases/download/${RELEASE}/koel-${RELEASE}.zip
unzip -q koel-${RELEASE}.zip
cd /opt/koel
composer update --no-interaction >/dev/null 2>&1
composer install --no-interaction >/dev/null 2>&1
php artisan migrate --force >/dev/null 2>&1
php artisan cache:clear >/dev/null 2>&1
php artisan config:clear >/dev/null 2>&1
php artisan view:clear >/dev/null 2>&1
php artisan koel:init --no-interaction >/dev/null 2>&1
msg_ok "Updated ${APP} to v${RELEASE}"
msg_info "Starting ${APP} Service"
systemctl start nginx
msg_ok "Started ${APP} Service"
msg_info "Cleaning up"
rm -rf /opt/koel-${RELEASE}.zip
msg_ok "Cleaned"
msg_ok "Updated Successfully!\n"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit
} }
start start

View File

@ -36,7 +36,7 @@ function update_script() {
msg_info "Updating ${APP} to v${RELEASE}" msg_info "Updating ${APP} to v${RELEASE}"
mv /opt/maxun /opt/maxun_bak mv /opt/maxun /opt/maxun_bak
cd /opt cd /opt
wget -q "https://github.com/getmaxun/maxun/archive/refs/tags/v${RELEASE}.zip" curl -fsSL "https://github.com/getmaxun/maxun/archive/refs/tags/v${RELEASE}.zip"
unzip -q v${RELEASE}.zip unzip -q v${RELEASE}.zip
mv maxun-${RELEASE} /opt/maxun mv maxun-${RELEASE} /opt/maxun
mv /opt/maxun_bak/.env /opt/maxun/ mv /opt/maxun_bak/.env /opt/maxun/

View File

@ -14,7 +14,7 @@ var_os="debian"
var_version="12" var_version="12"
var_unprivileged="1" var_unprivileged="1"
header_info "$APP" header_info "$APP"
variables variables
color color
catch_errors catch_errors
@ -27,7 +27,7 @@ function update_script() {
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
if ! command -v pnpm &> /dev/null; then if ! command -v pnpm &>/dev/null; then
msg_info "Installing pnpm" msg_info "Installing pnpm"
#export NODE_OPTIONS=--openssl-legacy-provider #export NODE_OPTIONS=--openssl-legacy-provider
$STD npm install -g pnpm@8.15 $STD npm install -g pnpm@8.15
@ -51,7 +51,7 @@ function update_script() {
msg_ok "Cleaned Old Files" msg_ok "Cleaned Old Files"
msg_info "Downloading NPM v${RELEASE}" msg_info "Downloading NPM v${RELEASE}"
wget -q https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v${RELEASE} -O - | tar -xz curl -fsSL https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v${RELEASE} -O - | tar -xz
cd nginx-proxy-manager-${RELEASE} cd nginx-proxy-manager-${RELEASE}
msg_ok "Downloaded NPM v${RELEASE}" msg_ok "Downloaded NPM v${RELEASE}"

View File

@ -19,22 +19,21 @@ color
catch_errors catch_errors
function update_script() { function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -d /opt/pixelfed ]]; then if [[ ! -d /opt/pixelfed ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -s https://api.github.com/repos/xxxx/xxxx/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Updating ${APP} to ${RELEASE}"
cd /opt
wget -q
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit exit
fi
RELEASE=$(curl -s https://api.github.com/repos/xxxx/xxxx/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Updating ${APP} to ${RELEASE}"
cd /opt
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
} }
start start

View File

@ -20,39 +20,39 @@ color
catch_errors catch_errors
function update_script() { function update_script() {
header_info header_info
if [[ ! -d /opt/roundcubemail ]]; then if [[ ! -d /opt/roundcubemail ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit
fi
if (($(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80)); then
read -r -p "Warning: Storage is dangerously low, continue anyway? <y/N> " prompt
[[ ${prompt,,} =~ ^(y|yes)$ ]] || exit
fi
RELEASE=$(curl -s https://api.github.com/repos/roundcube/roundcubemail/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Updating ${APP} to ${RELEASE}"
cd /opt
wget -q "https://github.com/roundcube/roundcubemail/releases/download/${RELEASE}/roundcubemail-${RELEASE}-complete.tar.gz"
tar -xf roundcubemail-${RELEASE}-complete.tar.gz
mv roundcubemail-${RELEASE} /opt/roundcubemail
cd /opt/roundcubemail
COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev
chown -R www-data:www-data temp/ logs/
msg_ok "Updated ${APP}"
msg_info "Reload Apache2"
systemctl reload apache2
msg_ok "Apache2 Reloaded"
msg_info "Cleaning Up"
rm -rf /opt/roundcubemail-${RELEASE}-complete.tar.gz
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit exit
fi
if (($(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80)); then
read -r -p "Warning: Storage is dangerously low, continue anyway? <y/N> " prompt
[[ ${prompt,,} =~ ^(y|yes)$ ]] || exit
fi
RELEASE=$(curl -s https://api.github.com/repos/roundcube/roundcubemail/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Updating ${APP} to ${RELEASE}"
cd /opt
curl -fsSL "https://github.com/roundcube/roundcubemail/releases/download/${RELEASE}/roundcubemail-${RELEASE}-complete.tar.gz"
tar -xf roundcubemail-${RELEASE}-complete.tar.gz
mv roundcubemail-${RELEASE} /opt/roundcubemail
cd /opt/roundcubemail
COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev
chown -R www-data:www-data temp/ logs/
msg_ok "Updated ${APP}"
msg_info "Reload Apache2"
systemctl reload apache2
msg_ok "Apache2 Reloaded"
msg_info "Cleaning Up"
rm -rf /opt/roundcubemail-${RELEASE}-complete.tar.gz
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
} }
start start

View File

@ -20,58 +20,58 @@ color
catch_errors catch_errors
function update_script() { function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -d /opt/cwa ]]; then if [[ ! -d /opt/cwa ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -s https://api.github.com/repos/crocodilestick/Calibre-Web-Automated/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
msg_info "Stopping $APP"
systemctl stop cps cwa-autolibrary cwa-ingester cwa-change-detector cwa-autozip.timer
msg_ok "Stopped $APP"
msg_info "Creating Backup"
$STD tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /opt/cwa /opt/calibre-web/metadata.db
msg_ok "Backup Created"
msg_info "Updating $APP to v${RELEASE}"
cd /opt/kepubify
rm -rf kepubify-linux-64bit
curl -fsSLO https://github.com/pgaskin/kepubify/releases/latest/download/kepubify-linux-64bit
chmod +x kepubify-linux-64bit
cd /opt/calibre-web
$STD pip install --upgrade calibreweb[goodreads,metadata,kobo]
cd /opt/cwa
$STD git stash --all
$STD git pull
$STD pip install -r requirements.txt
wget -q https://gist.githubusercontent.com/vhsdream/2e81afeff139c5746db1ede88c01cc7b/raw/51238206e87aec6c0abeccce85dec9f2b0c89000/proxmox-lxc.patch -O /opt/cwa.patch # not for production
$STD git apply --whitespace=fix /opt/cwa.patch # not for production
cp -r /opt/cwa/root/app/calibre-web/cps/* /usr/local/lib/python3*/dist-packages/calibreweb/cps
cd scripts
chmod +x check-cwa-services.sh ingest-service.sh change-detector.sh
msg_ok "Updated $APP to v${RELEASE}"
msg_info "Starting $APP"
systemctl start cps cwa-autolibrary cwa-ingester cwa-change-detector cwa-autozip.timer
msg_ok "Started $APP"
msg_info "Cleaning Up"
rm -rf /opt/cwa.patch
rm -rf "/opt/${APP}_backup_$(date +%F).tar.gz"
msg_ok "Cleanup Completed"
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Update Successful"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit exit
fi
RELEASE=$(curl -s https://api.github.com/repos/crocodilestick/Calibre-Web-Automated/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
msg_info "Stopping $APP"
systemctl stop cps cwa-autolibrary cwa-ingester cwa-change-detector cwa-autozip.timer
msg_ok "Stopped $APP"
msg_info "Creating Backup"
$STD tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /opt/cwa /opt/calibre-web/metadata.db
msg_ok "Backup Created"
msg_info "Updating $APP to v${RELEASE}"
cd /opt/kepubify
rm -rf kepubify-linux-64bit
curl -fsSLO https://github.com/pgaskin/kepubify/releases/latest/download/kepubify-linux-64bit
chmod +x kepubify-linux-64bit
cd /opt/calibre-web
$STD pip install --upgrade calibreweb[goodreads,metadata,kobo]
cd /opt/cwa
$STD git stash --all
$STD git pull
$STD pip install -r requirements.txt
curl -fsSL https://gist.githubusercontent.com/vhsdream/2e81afeff139c5746db1ede88c01cc7b/raw/51238206e87aec6c0abeccce85dec9f2b0c89000/proxmox-lxc.patch -O /opt/cwa.patch # not for production
$STD git apply --whitespace=fix /opt/cwa.patch # not for production
cp -r /opt/cwa/root/app/calibre-web/cps/* /usr/local/lib/python3*/dist-packages/calibreweb/cps
cd scripts
chmod +x check-cwa-services.sh ingest-service.sh change-detector.sh
msg_ok "Updated $APP to v${RELEASE}"
msg_info "Starting $APP"
systemctl start cps cwa-autolibrary cwa-ingester cwa-change-detector cwa-autozip.timer
msg_ok "Started $APP"
msg_info "Cleaning Up"
rm -rf /opt/cwa.patch
rm -rf "/opt/${APP}_backup_$(date +%F).tar.gz"
msg_ok "Cleanup Completed"
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Update Successful"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit
} }
start start

View File

@ -20,47 +20,47 @@ color
catch_errors catch_errors
function update_script() { function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -d /opt/fileflows ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
update_available=$(curl -s -X 'GET' "http://localhost:19200/api/status/update-available" -H 'accept: application/json' | jq .UpdateAvailable)
if [[ "${update_available}" == "true" ]]; then
msg_info "Stopping $APP"
systemctl stop fileflows
msg_ok "Stopped $APP"
msg_info "Creating Backup"
backup_filename="/opt/${APP}_backup_$(date +%F).tar.gz"
tar -czf $backup_filename -C /opt/fileflows Data
msg_ok "Backup Created"
msg_info "Updating $APP to latest version"
temp_file=$(mktemp)
wget -q https://fileflows.com/downloads/zip -O $temp_file
unzip -oq -d /opt/fileflows $temp_file
msg_ok "Updated $APP to latest version"
msg_info "Starting $APP"
systemctl start fileflows
msg_ok "Started $APP"
msg_info "Cleaning Up"
rm -rf $temp_file
rm -rf $backup_filename
msg_ok "Cleanup Completed"
msg_ok "Update Successful"
else
msg_ok "No update required. ${APP} is already at latest version"
fi
if [[ ! -d /opt/fileflows ]]; then
msg_error "No ${APP} Installation Found!"
exit exit
fi
update_available=$(curl -s -X 'GET' "http://localhost:19200/api/status/update-available" -H 'accept: application/json' | jq .UpdateAvailable)
if [[ "${update_available}" == "true" ]]; then
msg_info "Stopping $APP"
systemctl stop fileflows
msg_ok "Stopped $APP"
msg_info "Creating Backup"
backup_filename="/opt/${APP}_backup_$(date +%F).tar.gz"
tar -czf $backup_filename -C /opt/fileflows Data
msg_ok "Backup Created"
msg_info "Updating $APP to latest version"
temp_file=$(mktemp)
curl -fsSL https://fileflows.com/downloads/zip -O $temp_file
unzip -oq -d /opt/fileflows $temp_file
msg_ok "Updated $APP to latest version"
msg_info "Starting $APP"
systemctl start fileflows
msg_ok "Started $APP"
msg_info "Cleaning Up"
rm -rf $temp_file
rm -rf $backup_filename
msg_ok "Cleanup Completed"
msg_ok "Update Successful"
else
msg_ok "No update required. ${APP} is already at latest version"
fi
exit
} }
start start

View File

@ -20,69 +20,69 @@ color
catch_errors catch_errors
function update_script() { function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -f /opt/meilisearch_version.txt ]]; then if [[ ! -f /opt/meilisearch_version.txt ]]; then
msg_error "No Meilisearch Installation Found!" msg_error "No Meilisearch Installation Found!"
exit exit
fi
UPD=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Meilisearch Update" --radiolist --cancel-button Exit-Script "Spacebar = Select" 10 58 2 \
"1" "Update Meilisearch" ON \
"2" "Update Meilisearch-UI" OFF \
3>&1 1>&2 2>&3)
if [ "$UPD" == "1" ]; then
msg_info "Stopping Meilisearch"
systemctl stop meilisearch
msg_ok "Stopped Meilisearch"
msg_info "Updating Meilisearch"
tmp_file=$(mktemp)
RELEASE=$(curl -s https://api.github.com/repos/meilisearch/meilisearch/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
curl -fsSL https://github.com/meilisearch/meilisearch/releases/latest/download/meilisearch.deb -O $tmp_file
$STD dpkg -i $tmp_file
echo "$RELEASE" >/opt/meilisearch_version.txt
msg_ok "Updated Meilisearch"
msg_info "Starting Meilisearch"
systemctl start meilisearch
msg_ok "Started Meilisearch"
exit
fi
if [ "$UPD" == "2" ]; then
if [[ ! -f /opt/meilisearch-ui_version.txt ]]; then
msg_error "No Meilisearch-UI Installation Found!"
exit
fi fi
UPD=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Meilisearch Update" --radiolist --cancel-button Exit-Script "Spacebar = Select" 10 58 2 \ msg_info "Stopping Meilisearch-UI"
"1" "Update Meilisearch" ON \ systemctl stop meilisearch-ui
"2" "Update Meilisearch-UI" OFF \ msg_ok "Stopped Meilisearch-UI"
3>&1 1>&2 2>&3)
if [ "$UPD" == "1" ]; then msg_info "Updating Meilisearch-UI"
msg_info "Stopping Meilisearch" tmp_file=$(mktemp)
systemctl stop meilisearch tmp_dir=$(mktemp -d)
msg_ok "Stopped Meilisearch" RELEASE_UI=$(curl -s https://api.github.com/repos/riccox/meilisearch-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
cp /opt/meilisearch-ui/.env.local /tmp/.env.local.bak
rm -rf /opt/meilisearch-ui
mkdir -p /opt/meilisearch-ui
curl -fsSL "https://github.com/riccox/meilisearch-ui/archive/refs/tags/${RELEASE_UI}.zip" -O $tmp_file
unzip -q "$tmp_file" -d "$tmp_dir"
mv "$tmp_dir"/*/* /opt/meilisearch-ui/
cd /opt/meilisearch-ui
sed -i 's|const hash = execSync("git rev-parse HEAD").toString().trim();|const hash = "unknown";|' /opt/meilisearch-ui/vite.config.ts
mv /tmp/.env.local.bak /opt/meilisearch-ui/.env.local
$STD pnpm install
echo "$RELEASE_UI" >/opt/meilisearch-ui_version.txt
msg_ok "Updated Meilisearch-UI"
msg_info "Updating Meilisearch" msg_info "Starting Meilisearch-UI"
tmp_file=$(mktemp) systemctl start meilisearch-ui
RELEASE=$(curl -s https://api.github.com/repos/meilisearch/meilisearch/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') msg_ok "Started Meilisearch-UI"
wget -q https://github.com/meilisearch/meilisearch/releases/latest/download/meilisearch.deb -O $tmp_file exit
$STD dpkg -i $tmp_file fi
echo "$RELEASE" >/opt/meilisearch_version.txt
msg_ok "Updated Meilisearch"
msg_info "Starting Meilisearch"
systemctl start meilisearch
msg_ok "Started Meilisearch"
exit
fi
if [ "$UPD" == "2" ]; then
if [[ ! -f /opt/meilisearch-ui_version.txt ]]; then
msg_error "No Meilisearch-UI Installation Found!"
exit
fi
msg_info "Stopping Meilisearch-UI"
systemctl stop meilisearch-ui
msg_ok "Stopped Meilisearch-UI"
msg_info "Updating Meilisearch-UI"
tmp_file=$(mktemp)
tmp_dir=$(mktemp -d)
RELEASE_UI=$(curl -s https://api.github.com/repos/riccox/meilisearch-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
cp /opt/meilisearch-ui/.env.local /tmp/.env.local.bak
rm -rf /opt/meilisearch-ui
mkdir -p /opt/meilisearch-ui
wget -q "https://github.com/riccox/meilisearch-ui/archive/refs/tags/${RELEASE_UI}.zip" -O $tmp_file
unzip -q "$tmp_file" -d "$tmp_dir"
mv "$tmp_dir"/*/* /opt/meilisearch-ui/
cd /opt/meilisearch-ui
sed -i 's|const hash = execSync("git rev-parse HEAD").toString().trim();|const hash = "unknown";|' /opt/meilisearch-ui/vite.config.ts
mv /tmp/.env.local.bak /opt/meilisearch-ui/.env.local
$STD pnpm install
echo "$RELEASE_UI" >/opt/meilisearch-ui_version.txt
msg_ok "Updated Meilisearch-UI"
msg_info "Starting Meilisearch-UI"
systemctl start meilisearch-ui
msg_ok "Started Meilisearch-UI"
exit
fi
} }
start start

View File

@ -20,44 +20,44 @@ color
catch_errors catch_errors
function update_script() { function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -f /etc/systemd/system/qbittorrent-nox.service ]]; then if [[ ! -f /etc/systemd/system/qbittorrent-nox.service ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit
fi
if [[ ! -f /opt/${APP}_version.txt ]]; then
touch /opt/${APP}_version.txt
mkdir -p $HOME/.config/qBittorrent/
mkdir -p /opt/qbittorrent/
mv /.config/qBittorrent $HOME/.config/
$STD apt-get remove --purge -y qbittorrent-nox
sed -i 's@ExecStart=/usr/bin/qbittorrent-nox@ExecStart=/opt/qbittorrent/qbittorrent-nox@g' /etc/systemd/system/qbittorrent-nox.service
systemctl daemon-reload
fi
FULLRELEASE=$(curl -s https://api.github.com/repos/userdocs/qbittorrent-nox-static/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
RELEASE=$(echo $FULLRELEASE | cut -c 9-13)
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping Service"
systemctl stop qbittorrent-nox
msg_ok "Stopped Service"
msg_info "Updating ${APP} to v${RELEASE}"
rm -f /opt/qbittorrent/qbittorrent-nox
wget -q "https://github.com/userdocs/qbittorrent-nox-static/releases/download/${FULLRELEASE}/x86_64-qbittorrent-nox" -O /opt/qbittorrent/qbittorrent-nox
chmod +x /opt/qbittorrent/qbittorrent-nox
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated $APP to v${RELEASE}"
msg_info "Starting Service"
systemctl start qbittorrent-nox
msg_ok "Started Service"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit exit
fi
if [[ ! -f /opt/${APP}_version.txt ]]; then
touch /opt/${APP}_version.txt
mkdir -p $HOME/.config/qBittorrent/
mkdir -p /opt/qbittorrent/
mv /.config/qBittorrent $HOME/.config/
$STD apt-get remove --purge -y qbittorrent-nox
sed -i 's@ExecStart=/usr/bin/qbittorrent-nox@ExecStart=/opt/qbittorrent/qbittorrent-nox@g' /etc/systemd/system/qbittorrent-nox.service
systemctl daemon-reload
fi
FULLRELEASE=$(curl -s https://api.github.com/repos/userdocs/qbittorrent-nox-static/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
RELEASE=$(echo $FULLRELEASE | cut -c 9-13)
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping Service"
systemctl stop qbittorrent-nox
msg_ok "Stopped Service"
msg_info "Updating ${APP} to v${RELEASE}"
rm -f /opt/qbittorrent/qbittorrent-nox
curl -fsSL "https://github.com/userdocs/qbittorrent-nox-static/releases/download/${FULLRELEASE}/x86_64-qbittorrent-nox" -O /opt/qbittorrent/qbittorrent-nox
chmod +x /opt/qbittorrent/qbittorrent-nox
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated $APP to v${RELEASE}"
msg_info "Starting Service"
systemctl start qbittorrent-nox
msg_ok "Started Service"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit
} }
start start

View File

@ -20,54 +20,54 @@ color
catch_errors catch_errors
function update_script() { function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -d /opt/slskd ]] || [[ ! -d /opt/soularr ]]; then if [[ ! -d /opt/slskd ]] || [[ ! -d /opt/soularr ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -s https://api.github.com/repos/slskd/slskd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
msg_info "Stopping $APP and Soularr"
systemctl stop slskd soularr.timer soularr.service
msg_ok "Stopped $APP and Soularr"
msg_info "Updating $APP to v${RELEASE}"
tmp_file=$(mktemp)
wget -q "https://github.com/slskd/slskd/releases/download/${RELEASE}/slskd-${RELEASE}-linux-x64.zip" -O $tmp_file
unzip -q -oj $tmp_file slskd -d /opt/${APP}
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated $APP to v${RELEASE}"
msg_info "Updating Soularr"
cp /opt/soularr/config.ini /opt/config.ini.bak
cp /opt/soularr/run.sh /opt/run.sh.bak
cd /tmp
rm -rf /opt/soularr
wget -q https://github.com/mrusse/soularr/archive/refs/heads/main.zip
unzip -q main.zip
mv soularr-main /opt/soularr
cd /opt/soularr
$STD pip install -r requirements.txt
mv /opt/config.ini.bak /opt/soularr/config.ini
mv /opt/run.sh.bak /opt/soularr/run.sh
msg_ok "Soularr updated"
msg_info "Starting $APP and Soularr"
systemctl start slskd soularr.timer
msg_ok "Started $APP and Soularr"
msg_info "Cleaning Up"
rm -rf $tmp_file
rm -rf /tmp/main.zip
msg_ok "Cleanup Completed"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit exit
fi
RELEASE=$(curl -s https://api.github.com/repos/slskd/slskd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
msg_info "Stopping $APP and Soularr"
systemctl stop slskd soularr.timer soularr.service
msg_ok "Stopped $APP and Soularr"
msg_info "Updating $APP to v${RELEASE}"
tmp_file=$(mktemp)
curl -fsSL "https://github.com/slskd/slskd/releases/download/${RELEASE}/slskd-${RELEASE}-linux-x64.zip" -O $tmp_file
unzip -q -oj $tmp_file slskd -d /opt/${APP}
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated $APP to v${RELEASE}"
msg_info "Updating Soularr"
cp /opt/soularr/config.ini /opt/config.ini.bak
cp /opt/soularr/run.sh /opt/run.sh.bak
cd /tmp
rm -rf /opt/soularr
curl -fsSL https://github.com/mrusse/soularr/archive/refs/heads/main.zip
unzip -q main.zip
mv soularr-main /opt/soularr
cd /opt/soularr
$STD pip install -r requirements.txt
mv /opt/config.ini.bak /opt/soularr/config.ini
mv /opt/run.sh.bak /opt/soularr/run.sh
msg_ok "Soularr updated"
msg_info "Starting $APP and Soularr"
systemctl start slskd soularr.timer
msg_ok "Started $APP and Soularr"
msg_info "Cleaning Up"
rm -rf $tmp_file
rm -rf /tmp/main.zip
msg_ok "Cleanup Completed"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit
} }
start start

View File

@ -40,7 +40,7 @@
- Import the build.func file. - Import the build.func file.
- When developing your own script, change the URL to your own repository. - When developing your own script, change the URL to your own repository.
> [!IMPORTANT] > [!IMPORTANT]
> You also need to change all apperances of this URL in `misc/build.func` and `misc/install.func` > You also need to change all apperances of this URL in `misc/build.func` and `misc/install.func`
Example for development: Example for development:
@ -95,7 +95,7 @@ Example:
>| Variable | Description | Notes | >| Variable | Description | Notes |
>|----------|-------------|-------| >|----------|-------------|-------|
>| `APP` | Application name | Must match ct\AppName.sh | >| `APP` | Application name | Must match ct\AppName.sh |
>| `var_tags` | Proxmox display tags without Spaces, only ; | Limit the number | >| `var_tags` | Proxmox display tags without Spaces, only ; | Limit the number |
>| `var_cpu` | CPU cores | Number of cores | >| `var_cpu` | CPU cores | Number of cores |
>| `var_ram` | RAM | In MB | >| `var_ram` | RAM | In MB |
>| `var_disk` | Disk capacity | In GB | >| `var_disk` | Disk capacity | In GB |
@ -189,7 +189,7 @@ Example with a Github Release:
Example: Example:
```bash ```bash
wget -q curl -fsSL
unzip -q unzip -q
``` ```
@ -198,8 +198,8 @@ unzip -q
Example: Example:
```bash ```bash
$STD php artisan migrate --force $STD php artisan migrate --force
$STD php artisan config:clear $STD php artisan config:clear
``` ```
### 3.5 **Backups** ### 3.5 **Backups**

View File

@ -115,7 +115,7 @@ $STD apt-get install -y \
git \ git \
sudo \ sudo \
mc \ mc \
nginx nginx
``` ```
### 3.2 **Collapse dependencies** ### 3.2 **Collapse dependencies**
@ -154,7 +154,7 @@ Example for a git release:
```bash ```bash
RELEASE=$(curl -fsSL https://api.github.com/repos/snipe/snipe-it/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -fsSL https://api.github.com/repos/snipe/snipe-it/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
wget -q "https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE}.zip" curl -fsSL "https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE}.zip"
``` ```
### 5.2 **Save the version for update checks** ### 5.2 **Save the version for update checks**
@ -192,7 +192,7 @@ msg_ok "Installed Dependencies"
Example: Example:
```bash ```bash
wget -q curl -fsSL
unzip -q unzip -q
``` ```

View File

@ -6,7 +6,7 @@
# Source: [SOURCE_URL] # Source: [SOURCE_URL]
# Import Functions und Setup # Import Functions und Setup
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color color
verb_ip6 verb_ip6
catch_errors catch_errors
@ -34,11 +34,11 @@ $STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');" $STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
$STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;" $STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
{ {
echo "${APPLICATION} Credentials" echo "${APPLICATION} Credentials"
echo "Database User: $DB_USER" echo "Database User: $DB_USER"
echo "Database Password: $DB_PASS" echo "Database Password: $DB_PASS"
echo "Database Name: $DB_NAME" echo "Database Name: $DB_NAME"
} >> ~/$APP_NAME.creds } >>~/$APP_NAME.creds
msg_ok "Set up Database" msg_ok "Set up Database"
# Temp # Temp
@ -46,11 +46,11 @@ msg_ok "Set up Database"
# Setup App # Setup App
msg_info "Setup ${APPLICATION}" msg_info "Setup ${APPLICATION}"
RELEASE=$(curl -s https://api.github.com/repos/[REPO]/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') RELEASE=$(curl -s https://api.github.com/repos/[REPO]/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
wget -q "https://github.com/[REPO]/archive/refs/tags/${RELEASE}.zip" curl -fsSL "https://github.com/[REPO]/archive/refs/tags/${RELEASE}.zip"
unzip -q ${RELEASE}.zip unzip -q ${RELEASE}.zip
mv ${APPLICATION}-${RELEASE}/ /opt/${APPLICATION} mv ${APPLICATION}-${RELEASE}/ /opt/${APPLICATION}
# #
# #
# #
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Setup ${APPLICATION}" msg_ok "Setup ${APPLICATION}"
@ -80,4 +80,4 @@ msg_info "Cleaning up"
rm -f ${RELEASE}.zip rm -f ${RELEASE}.zip
$STD apt-get -y autoremove $STD apt-get -y autoremove
$STD apt-get -y autoclean $STD apt-get -y autoclean
msg_ok "Cleaned" msg_ok "Cleaned"

View File

@ -4,82 +4,82 @@ import { basePath } from "@/config/siteConfig";
import { Script } from "@/lib/types"; import { Script } from "@/lib/types";
import { getDisplayValueFromType } from "../ScriptInfoBlocks"; import { getDisplayValueFromType } from "../ScriptInfoBlocks";
const getInstallCommand = (scriptPath?: string, isAlpine = false) => { const getInstallCommand = (scriptPath = "") => {
return `bash -c "$(wget -q${isAlpine ? "" : "L"}O - https://github.com/community-scripts/${basePath}/raw/main/${scriptPath})"`; return `bash -c "$(curl -fsSL https://github.com/community-scripts/${basePath}/raw/main/${scriptPath})"`;
}; };
export default function InstallCommand({ item }: { item: Script }) { export default function InstallCommand({ item }: { item: Script }) {
const alpineScript = item.install_methods.find( const alpineScript = item.install_methods.find(
(method) => method.type === "alpine", (method) => method.type === "alpine",
); );
const defaultScript = item.install_methods.find( const defaultScript = item.install_methods.find(
(method) => method.type === "default", (method) => method.type === "default",
); );
const renderInstructions = (isAlpine = false) => ( const renderInstructions = (isAlpine = false) => (
<>
<p className="text-sm mt-2">
{isAlpine ? (
<>
As an alternative option, you can use Alpine Linux and the{" "}
{item.name} package to create a {item.name}{" "}
{getDisplayValueFromType(item.type)} container with faster creation
time and minimal system resource usage. You are also obliged to
adhere to updates provided by the package maintainer.
</>
) : item.type == "misc" ? (
<>
To use the {item.name} script, run the command below in the shell.
</>
) : (
<>
{" "}
To create a new Proxmox VE {item.name}{" "}
{getDisplayValueFromType(item.type)}, run the command below in the
Proxmox VE Shell.
</>
)}
</p>
{isAlpine && (
<p className="mt-2 text-sm">
To create a new Proxmox VE Alpine-{item.name}{" "}
{getDisplayValueFromType(item.type)}, run the command below in the
Proxmox VE Shell
</p>
)}
</>
);
return (
<div className="p-4">
{alpineScript ? (
<Tabs defaultValue="default" className="mt-2 w-full max-w-4xl">
<TabsList>
<TabsTrigger value="default">Default</TabsTrigger>
<TabsTrigger value="alpine">Alpine Linux</TabsTrigger>
</TabsList>
<TabsContent value="default">
{renderInstructions()}
<CodeCopyButton>
{getInstallCommand(defaultScript?.script)}
</CodeCopyButton>
</TabsContent>
<TabsContent value="alpine">
{renderInstructions(true)}
<CodeCopyButton>
{getInstallCommand(alpineScript.script, true)}
</CodeCopyButton>
</TabsContent>
</Tabs>
) : defaultScript?.script ? (
<> <>
{renderInstructions()} <p className="text-sm mt-2">
<CodeCopyButton> {isAlpine ? (
{getInstallCommand(defaultScript.script)} <>
</CodeCopyButton> As an alternative option, you can use Alpine Linux and the{" "}
{item.name} package to create a {item.name}{" "}
{getDisplayValueFromType(item.type)} container with faster creation
time and minimal system resource usage. You are also obliged to
adhere to updates provided by the package maintainer.
</>
) : item.type == "misc" ? (
<>
To use the {item.name} script, run the command below in the shell.
</>
) : (
<>
{" "}
To create a new Proxmox VE {item.name}{" "}
{getDisplayValueFromType(item.type)}, run the command below in the
Proxmox VE Shell.
</>
)}
</p>
{isAlpine && (
<p className="mt-2 text-sm">
To create a new Proxmox VE Alpine-{item.name}{" "}
{getDisplayValueFromType(item.type)}, run the command below in the
Proxmox VE Shell
</p>
)}
</> </>
) : null} );
</div>
); return (
<div className="p-4">
{alpineScript ? (
<Tabs defaultValue="default" className="mt-2 w-full max-w-4xl">
<TabsList>
<TabsTrigger value="default">Default</TabsTrigger>
<TabsTrigger value="alpine">Alpine Linux</TabsTrigger>
</TabsList>
<TabsContent value="default">
{renderInstructions()}
<CodeCopyButton>
{getInstallCommand(defaultScript?.script)}
</CodeCopyButton>
</TabsContent>
<TabsContent value="alpine">
{renderInstructions(true)}
<CodeCopyButton>
{getInstallCommand(alpineScript.script, true)}
</CodeCopyButton>
</TabsContent>
</Tabs>
) : defaultScript?.script ? (
<>
{renderInstructions()}
<CodeCopyButton>
{getInstallCommand(defaultScript.script)}
</CodeCopyButton>
</>
) : null}
</div>
);
} }

View File

@ -47,7 +47,7 @@ msg_info "Installing Calibre-Web (Patience)"
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
mkdir -p /opt/calibre-web mkdir -p /opt/calibre-web
$STD apt-get install -y calibre $STD apt-get install -y calibre
$STD wget https://github.com/janeczku/calibre-web/raw/master/library/metadata.db -P /opt/calibre-web $STD curl -fsSL -o /opt/calibre-web/metadata.db https://github.com/janeczku/calibre-web/raw/master/library/metadata.db
$STD pip install calibreweb[goodreads,metadata,kobo] $STD pip install calibreweb[goodreads,metadata,kobo]
$STD pip install jsonschema $STD pip install jsonschema
msg_ok "Installed Calibre-Web" msg_ok "Installed Calibre-Web"
@ -81,7 +81,7 @@ $STD git clone https://github.com/crocodilestick/Calibre-Web-Automated.git /opt/
cd /opt/cwa cd /opt/cwa
$STD git checkout V${RELEASE} $STD git checkout V${RELEASE}
$STD pip install -r requirements.txt $STD pip install -r requirements.txt
wget -q https://gist.githubusercontent.com/vhsdream/2e81afeff139c5746db1ede88c01cc7b/raw/51238206e87aec6c0abeccce85dec9f2b0c89000/proxmox-lxc.patch -O /opt/cwa.patch # not for production curl -fsSL https://gist.githubusercontent.com/vhsdream/2e81afeff139c5746db1ede88c01cc7b/raw/51238206e87aec6c0abeccce85dec9f2b0c89000/proxmox-lxc.patch -O /opt/cwa.patch # not for production
$STD git apply --whitespace=fix /opt/cwa.patch # not for production $STD git apply --whitespace=fix /opt/cwa.patch # not for production
cd scripts cd scripts
chmod +x check-cwa-services.sh ingest-service.sh change-detector.sh chmod +x check-cwa-services.sh ingest-service.sh change-detector.sh

View File

@ -15,26 +15,25 @@ update_os
msg_info "Installing Dependencies (Patience)" msg_info "Installing Dependencies (Patience)"
$STD apt-get install -y \ $STD apt-get install -y \
unzip \ unzip \
htop \ htop \
gnupg2 \ gnupg2 \
ca-certificates \ ca-certificates \
default-jdk \ default-jdk \
apt-transport-https \ apt-transport-https \
ghostscript \ ghostscript \
tesseract-ocr \ tesseract-ocr \
tesseract-ocr-deu \ tesseract-ocr-deu \
tesseract-ocr-eng \ tesseract-ocr-eng \
unpaper \ unpaper \
unoconv \ unoconv \
wkhtmltopdf \ wkhtmltopdf \
ocrmypdf \ ocrmypdf \
wget \ zip \
zip \ curl \
curl \ sudo \
sudo \ make \
make \ mc
mc
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Setting up PostgreSQL Repository" msg_info "Setting up PostgreSQL Repository"
@ -54,27 +53,27 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8'
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';" $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';" $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
{ {
echo "Docspell-Credentials" echo "Docspell-Credentials"
echo "Docspell Database Name: $DB_NAME" echo "Docspell Database Name: $DB_NAME"
echo "Docspell Database User: $DB_USER" echo "Docspell Database User: $DB_USER"
echo "Docspell Database Password: $DB_PASS" echo "Docspell Database Password: $DB_PASS"
} >>~/docspell.creds } >>~/docspell.creds
msg_ok "Set up PostgreSQL Database" msg_ok "Set up PostgreSQL Database"
msg_info "Setup Docspell (Patience)" msg_info "Setup Docspell (Patience)"
mkdir -p /opt/docspell mkdir -p /opt/docspell
Docspell=$(wget -q https://github.com/eikek/docspell/releases/latest -O - | grep "title>Release" | cut -d " " -f 5) Docspell=$(curl -fsSL https://github.com/eikek/docspell/releases/latest -O - | grep "title>Release" | cut -d " " -f 5)
DocspellDSC=$(wget -q https://github.com/docspell/dsc/releases/latest -O - | grep "title>Release" | cut -d " " -f 4 | sed 's/^v//') DocspellDSC=$(curl -fsSL https://github.com/docspell/dsc/releases/latest -O - | grep "title>Release" | cut -d " " -f 4 | sed 's/^v//')
cd /opt cd /opt
wget -q https://github.com/eikek/docspell/releases/download/v${Docspell}/docspell-joex_${Docspell}_all.deb curl -fsSL https://github.com/eikek/docspell/releases/download/v${Docspell}/docspell-joex_${Docspell}_all.deb
wget -q https://github.com/eikek/docspell/releases/download/v${Docspell}/docspell-restserver_${Docspell}_all.deb curl -fsSL https://github.com/eikek/docspell/releases/download/v${Docspell}/docspell-restserver_${Docspell}_all.deb
$STD dpkg -i docspell-*.deb $STD dpkg -i docspell-*.deb
wget -q https://github.com/docspell/dsc/releases/download/v${DocspellDSC}/dsc_amd64-musl-${DocspellDSC} curl -fsSL https://github.com/docspell/dsc/releases/download/v${DocspellDSC}/dsc_amd64-musl-${DocspellDSC}
mv dsc_amd* dsc mv dsc_amd* dsc
chmod +x dsc chmod +x dsc
mv dsc /usr/bin mv dsc /usr/bin
ln -s /etc/docspell-joex /opt/docspell/docspell-joex && ln -s /etc/docspell-restserver /opt/docspell/docspell-restserver && ln -s /usr/bin/dsc /opt/docspell/dsc ln -s /etc/docspell-joex /opt/docspell/docspell-joex && ln -s /etc/docspell-restserver /opt/docspell/docspell-restserver && ln -s /usr/bin/dsc /opt/docspell/dsc
wget -q https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq curl -fsSL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
chmod +x /usr/bin/yq chmod +x /usr/bin/yq
JOEX_CONF="/usr/share/docspell-joex/conf/docspell-joex.conf" JOEX_CONF="/usr/share/docspell-joex/conf/docspell-joex.conf"
SERVER_CONF="/usr/share/docspell-restserver/conf/docspell-server.conf" SERVER_CONF="/usr/share/docspell-restserver/conf/docspell-server.conf"
@ -105,7 +104,7 @@ cd /opt/docspell
SOLR_DOWNLOAD_URL="https://downloads.apache.org/lucene/solr/" SOLR_DOWNLOAD_URL="https://downloads.apache.org/lucene/solr/"
latest_version=$(curl -s "$SOLR_DOWNLOAD_URL" | grep -oP '(?<=<a href=")[^"]+(?=/">[0-9])' | head -n 1) latest_version=$(curl -s "$SOLR_DOWNLOAD_URL" | grep -oP '(?<=<a href=")[^"]+(?=/">[0-9])' | head -n 1)
download_url="${SOLR_DOWNLOAD_URL}${latest_version}/solr-${latest_version}.tgz" download_url="${SOLR_DOWNLOAD_URL}${latest_version}/solr-${latest_version}.tgz"
wget -q "$download_url" curl -fsSL "$download_url"
tar xzf "solr-$latest_version.tgz" tar xzf "solr-$latest_version.tgz"
$STD bash "/opt/docspell/solr-$latest_version/bin/install_solr_service.sh" "solr-$latest_version.tgz" $STD bash "/opt/docspell/solr-$latest_version/bin/install_solr_service.sh" "solr-$latest_version.tgz"
mv /opt/solr /opt/docspell/solr mv /opt/solr /opt/docspell/solr

View File

@ -45,7 +45,7 @@ fi
msg_ok "Installed and Set Up Intel Hardware Acceleration" msg_ok "Installed and Set Up Intel Hardware Acceleration"
msg_info "Installing ASP.NET Core Runtime" msg_info "Installing ASP.NET Core Runtime"
wget -q https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb curl -fsSL https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
$STD dpkg -i packages-microsoft-prod.deb $STD dpkg -i packages-microsoft-prod.deb
rm -rf packages-microsoft-prod.deb rm -rf packages-microsoft-prod.deb
$STD apt-get update $STD apt-get update
@ -56,7 +56,7 @@ msg_info "Setup ${APPLICATION}"
$STD ln -svf /usr/bin/ffmpeg /usr/local/bin/ffmpeg $STD ln -svf /usr/bin/ffmpeg /usr/local/bin/ffmpeg
$STD ln -svf /usr/bin/ffprobe /usr/local/bin/ffprobe $STD ln -svf /usr/bin/ffprobe /usr/local/bin/ffprobe
temp_file=$(mktemp) temp_file=$(mktemp)
wget -q https://fileflows.com/downloads/zip -O $temp_file curl -fsSL https://fileflows.com/downloads/zip -O $temp_file
unzip -q -d /opt/fileflows $temp_file unzip -q -d /opt/fileflows $temp_file
(cd /opt/fileflows/Server && dotnet FileFlows.Server.dll --systemd install --root true) (cd /opt/fileflows/Server && dotnet FileFlows.Server.dll --systemd install --root true)
systemctl enable -q --now fileflows.service systemctl enable -q --now fileflows.service

View File

@ -20,7 +20,6 @@ $STD apt-get install -y \
mc \ mc \
build-essential \ build-essential \
git \ git \
wget \
libnewt-dev \ libnewt-dev \
libssl-dev \ libssl-dev \
libncurses5-dev \ libncurses5-dev \
@ -79,7 +78,7 @@ msg_ok "Installed Dependencies"
msg_info "Installing Asterisk (Patience)" msg_info "Installing Asterisk (Patience)"
cd /usr/src cd /usr/src
wget -q http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-21-current.tar.gz curl -fsSL http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-21-current.tar.gz
tar xf asterisk-21-current.tar.gz tar xf asterisk-21-current.tar.gz
cd asterisk-21.* cd asterisk-21.*
$STD contrib/scripts/get_mp3_source.sh $STD contrib/scripts/get_mp3_source.sh
@ -138,7 +137,7 @@ EOF
msg_info "Installing FreePBX" msg_info "Installing FreePBX"
cd /usr/local/src cd /usr/local/src
wget -q http://mirror.freepbx.org/modules/packages/freepbx/freepbx-17.0-latest-EDGE.tgz curl -fsSL http://mirror.freepbx.org/modules/packages/freepbx/freepbx-17.0-latest-EDGE.tgz
tar zxf freepbx-17.0-latest-EDGE.tgz tar zxf freepbx-17.0-latest-EDGE.tgz
cd /usr/local/src/freepbx/ cd /usr/local/src/freepbx/
$STD ./start_asterisk start $STD ./start_asterisk start

View File

@ -15,16 +15,16 @@ update_os
msg_info "Installing Dependencies (Patience)" msg_info "Installing Dependencies (Patience)"
$STD apt-get install -y \ $STD apt-get install -y \
curl sudo mc git gpg ca-certificates automake build-essential xz-utils libtool ccache pkg-config \ curl sudo mc git gpg ca-certificates automake build-essential xz-utils libtool ccache pkg-config \
libgtk-3-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev \ libgtk-3-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev \
libjpeg-dev libpng-dev libtiff-dev gfortran openexr libatlas-base-dev libssl-dev libtbb-dev \ libjpeg-dev libpng-dev libtiff-dev gfortran openexr libatlas-base-dev libssl-dev libtbb-dev \
libopenexr-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev gcc gfortran \ libopenexr-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev gcc gfortran \
libopenblas-dev liblapack-dev libusb-1.0-0-dev jq moreutils tclsh libhdf5-dev libopenexr-dev libopenblas-dev liblapack-dev libusb-1.0-0-dev jq moreutils tclsh libhdf5-dev libopenexr-dev
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Setup Python3" msg_info "Setup Python3"
$STD apt-get install -y \ $STD apt-get install -y \
python3 python3-dev python3-setuptools python3-distutils python3-pip python3 python3-dev python3-setuptools python3-distutils python3-pip
$STD pip install --upgrade pip $STD pip install --upgrade pip
msg_ok "Setup Python3" msg_ok "Setup Python3"
@ -39,7 +39,7 @@ msg_ok "Installed Node.js"
msg_info "Installing go2rtc" msg_info "Installing go2rtc"
mkdir -p /usr/local/go2rtc/bin mkdir -p /usr/local/go2rtc/bin
cd /usr/local/go2rtc/bin cd /usr/local/go2rtc/bin
wget -qO go2rtc "https://github.com/AlexxIT/go2rtc/releases/latest/download/go2rtc_linux_amd64" curl -fsSL "https://github.com/AlexxIT/go2rtc/releases/latest/download/go2rtc_linux_amd64" -o go2rtc
chmod +x go2rtc chmod +x go2rtc
ln -sf /usr/local/go2rtc/bin/go2rtc /usr/local/bin/go2rtc ln -sf /usr/local/go2rtc/bin/go2rtc /usr/local/bin/go2rtc
msg_ok "Installed go2rtc" msg_ok "Installed go2rtc"
@ -47,16 +47,16 @@ msg_ok "Installed go2rtc"
msg_info "Setting Up Hardware Acceleration" msg_info "Setting Up Hardware Acceleration"
$STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools} $STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools}
if [[ "$CTTYPE" == "0" ]]; then if [[ "$CTTYPE" == "0" ]]; then
chgrp video /dev/dri chgrp video /dev/dri
chmod 755 /dev/dri chmod 755 /dev/dri
chmod 660 /dev/dri/* chmod 660 /dev/dri/*
fi fi
msg_ok "Set Up Hardware Acceleration" msg_ok "Set Up Hardware Acceleration"
msg_info "Setup Frigate" msg_info "Setup Frigate"
RELEASE=$(curl -s https://api.github.com/repos/blakeblackshear/frigate/releases/latest | jq -r '.tag_name') RELEASE=$(curl -s https://api.github.com/repos/blakeblackshear/frigate/releases/latest | jq -r '.tag_name')
mkdir -p /opt/frigate/models mkdir -p /opt/frigate/models
wget -q https://github.com/blakeblackshear/frigate/archive/refs/tags/${RELEASE}.tar.gz -O frigate.tar.gz curl -fsSL https://github.com/blakeblackshear/frigate/archive/refs/tags/${RELEASE}.tar.gz -O frigate.tar.gz
tar -xzf frigate.tar.gz -C /opt/frigate --strip-components 1 tar -xzf frigate.tar.gz -C /opt/frigate --strip-components 1
rm -rf frigate.tar.gz rm -rf frigate.tar.gz
cd /opt/frigate cd /opt/frigate
@ -102,21 +102,21 @@ cameras:
EOF EOF
ln -sf /config/config.yml /opt/frigate/config/config.yml ln -sf /config/config.yml /opt/frigate/config/config.yml
if [[ "$CTTYPE" == "0" ]]; then if [[ "$CTTYPE" == "0" ]]; then
sed -i -e 's/^kvm:x:104:$/render:x:104:root,frigate/' -e 's/^render:x:105:root$/kvm:x:105:/' /etc/group sed -i -e 's/^kvm:x:104:$/render:x:104:root,frigate/' -e 's/^render:x:105:root$/kvm:x:105:/' /etc/group
else else
sed -i -e 's/^kvm:x:104:$/render:x:104:frigate/' -e 's/^render:x:105:$/kvm:x:105:/' /etc/group sed -i -e 's/^kvm:x:104:$/render:x:104:frigate/' -e 's/^render:x:105:$/kvm:x:105:/' /etc/group
fi fi
echo "tmpfs /tmp/cache tmpfs defaults 0 0" >>/etc/fstab echo "tmpfs /tmp/cache tmpfs defaults 0 0" >>/etc/fstab
msg_ok "Installed Frigate $RELEASE" msg_ok "Installed Frigate $RELEASE"
read -p "Semantic Search requires a dedicated GPU and at least 16GB RAM. Would you like to install it? (y/n): " semantic_choice read -p "Semantic Search requires a dedicated GPU and at least 16GB RAM. Would you like to install it? (y/n): " semantic_choice
if [[ "$semantic_choice" == "y" ]]; then if [[ "$semantic_choice" == "y" ]]; then
msg_info "Configuring Semantic Search & AI Models" msg_info "Configuring Semantic Search & AI Models"
mkdir -p /opt/frigate/models/semantic_search mkdir -p /opt/frigate/models/semantic_search
wget -qO /opt/frigate/models/semantic_search/clip_model.pt https://huggingface.co/openai/clip-vit-base-patch32/resolve/main/pytorch_model.bin curl -fsSL -o /opt/frigate/models/semantic_search/clip_model.pt https://huggingface.co/openai/clip-vit-base-patch32/resolve/main/pytorch_model.bin
msg_ok "Semantic Search Models Installed" msg_ok "Semantic Search Models Installed"
else else
msg_ok "Skipped Semantic Search Setup" msg_ok "Skipped Semantic Search Setup"
fi fi
msg_info "Building and Installing libUSB without udev" msg_info "Building and Installing libUSB without udev"
wget -qO /tmp/libusb.zip https://github.com/libusb/libusb/archive/v1.0.26.zip wget -qO /tmp/libusb.zip https://github.com/libusb/libusb/archive/v1.0.26.zip
@ -134,7 +134,7 @@ msg_info "Installing Coral Object Detection Model (Patience)"
cd /opt/frigate cd /opt/frigate
export CCACHE_DIR=/root/.ccache export CCACHE_DIR=/root/.ccache
export CCACHE_MAXSIZE=2G export CCACHE_MAXSIZE=2G
wget -q https://github.com/libusb/libusb/archive/v1.0.26.zip curl -fsSL https://github.com/libusb/libusb/archive/v1.0.26.zip
unzip -q v1.0.26.zip unzip -q v1.0.26.zip
rm v1.0.26.zip rm v1.0.26.zip
cd libusb-1.0.26 cd libusb-1.0.26

View File

@ -60,7 +60,7 @@ msg_ok "Set up Database"
msg_info "Setup healthchecks" msg_info "Setup healthchecks"
cd /opt cd /opt
RELEASE=$(curl -s https://api.github.com/repos/healthchecks/healthchecks/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -s https://api.github.com/repos/healthchecks/healthchecks/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
wget -q "https://github.com/healthchecks/healthchecks/archive/refs/tags/v${RELEASE}.zip" curl -fsSL "https://github.com/healthchecks/healthchecks/archive/refs/tags/v${RELEASE}.zip"
unzip -q v${RELEASE}.zip unzip -q v${RELEASE}.zip
mv healthchecks-${RELEASE} /opt/healthchecks mv healthchecks-${RELEASE} /opt/healthchecks
cd /opt/healthchecks cd /opt/healthchecks
@ -127,4 +127,4 @@ msg_info "Cleaning up"
rm -rf /opt/v${RELEASE}.zip rm -rf /opt/v${RELEASE}.zip
$STD apt-get -y autoremove $STD apt-get -y autoremove
$STD apt-get -y autoclean $STD apt-get -y autoclean
msg_ok "Cleaned" msg_ok "Cleaned"

View File

@ -67,7 +67,7 @@ msg_ok "Added manyfold user"
msg_info "Installing Manyfold" msg_info "Installing Manyfold"
RELEASE=$(curl -s https://api.github.com/repos/manyfold3d/manyfold/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -s https://api.github.com/repos/manyfold3d/manyfold/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
cd /opt cd /opt
wget -q "https://github.com/manyfold3d/manyfold/archive/refs/tags/v${RELEASE}.zip" curl -fsSL "https://github.com/manyfold3d/manyfold/archive/refs/tags/v${RELEASE}.zip"
unzip -q "v${RELEASE}.zip" unzip -q "v${RELEASE}.zip"
mv /opt/manyfold-${RELEASE}/ /opt/manyfold mv /opt/manyfold-${RELEASE}/ /opt/manyfold
cd /opt/manyfold cd /opt/manyfold

View File

@ -24,9 +24,9 @@ msg_ok "Installed Dependencies"
msg_info "Setup ${APPLICATION}" msg_info "Setup ${APPLICATION}"
tmp_file=$(mktemp) tmp_file=$(mktemp)
RELEASE=$(curl -s https://api.github.com/repos/meilisearch/meilisearch/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') RELEASE=$(curl -s https://api.github.com/repos/meilisearch/meilisearch/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
wget -q https://github.com/meilisearch/meilisearch/releases/latest/download/meilisearch.deb -O $tmp_file curl -fsSL https://github.com/meilisearch/meilisearch/releases/latest/download/meilisearch.deb -O $tmp_file
$STD dpkg -i $tmp_file $STD dpkg -i $tmp_file
wget -q https://raw.githubusercontent.com/meilisearch/meilisearch/latest/config.toml -O /etc/meilisearch.toml curl -fsSL https://raw.githubusercontent.com/meilisearch/meilisearch/latest/config.toml -O /etc/meilisearch.toml
MASTER_KEY=$(openssl rand -base64 12) MASTER_KEY=$(openssl rand -base64 12)
LOCAL_IP="$(hostname -I | awk '{print $1}')" LOCAL_IP="$(hostname -I | awk '{print $1}')"
sed -i \ sed -i \
@ -60,7 +60,7 @@ if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
tmp_dir=$(mktemp -d) tmp_dir=$(mktemp -d)
mkdir -p /opt/meilisearch-ui mkdir -p /opt/meilisearch-ui
RELEASE_UI=$(curl -s https://api.github.com/repos/riccox/meilisearch-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') RELEASE_UI=$(curl -s https://api.github.com/repos/riccox/meilisearch-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
wget -q "https://github.com/riccox/meilisearch-ui/archive/refs/tags/${RELEASE_UI}.zip" -O $tmp_file curl -fsSL "https://github.com/riccox/meilisearch-ui/archive/refs/tags/${RELEASE_UI}.zip" -O $tmp_file
unzip -q "$tmp_file" -d "$tmp_dir" unzip -q "$tmp_file" -d "$tmp_dir"
mv "$tmp_dir"/*/* /opt/meilisearch-ui/ mv "$tmp_dir"/*/* /opt/meilisearch-ui/
cd /opt/meilisearch-ui cd /opt/meilisearch-ui

View File

@ -24,7 +24,7 @@ msg_info "Setup qBittorrent-nox"
FULLRELEASE=$(curl -s https://api.github.com/repos/userdocs/qbittorrent-nox-static/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') FULLRELEASE=$(curl -s https://api.github.com/repos/userdocs/qbittorrent-nox-static/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
RELEASE=$(echo $RELEASE | cut -c 9-13) RELEASE=$(echo $RELEASE | cut -c 9-13)
mkdir -p /opt/qbittorrent mkdir -p /opt/qbittorrent
wget -q "https://github.com/userdocs/qbittorrent-nox-static/releases/download/${FULLRELEASE}/x86_64-qbittorrent-nox -O /opt/qbittorrent/qbittorrent-nox" curl -fsSL "https://github.com/userdocs/qbittorrent-nox-static/releases/download/${FULLRELEASE}/x86_64-qbittorrent-nox -O /opt/qbittorrent/qbittorrent-nox"
chmod +x /opt/qbittorrent/qbittorrent-nox chmod +x /opt/qbittorrent/qbittorrent-nox
mkdir -p $HOME/.config/qBittorrent/ mkdir -p $HOME/.config/qBittorrent/
cat <<EOF >$HOME/.config/qBittorrent/qBittorrent.conf cat <<EOF >$HOME/.config/qBittorrent/qBittorrent.conf

View File

@ -25,7 +25,7 @@ msg_ok "Installed Dependencies"
msg_info "Setup ${APPLICATION}" msg_info "Setup ${APPLICATION}"
tmp_file=$(mktemp) tmp_file=$(mktemp)
RELEASE=$(curl -s https://api.github.com/repos/slskd/slskd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') RELEASE=$(curl -s https://api.github.com/repos/slskd/slskd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
wget -q "https://github.com/slskd/slskd/releases/download/${RELEASE}/slskd-${RELEASE}-linux-x64.zip" -O $tmp_file curl -fsSL "https://github.com/slskd/slskd/releases/download/${RELEASE}/slskd-${RELEASE}-linux-x64.zip" -O $tmp_file
unzip -q $tmp_file -d /opt/${APPLICATION} unzip -q $tmp_file -d /opt/${APPLICATION}
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
JWT_KEY=$(openssl rand -base64 44) JWT_KEY=$(openssl rand -base64 44)
@ -45,7 +45,7 @@ msg_ok "Setup ${APPLICATION}"
msg_info "Installing Soularr" msg_info "Installing Soularr"
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
cd /tmp cd /tmp
wget -q https://github.com/mrusse/soularr/archive/refs/heads/main.zip curl -fsSL https://github.com/mrusse/soularr/archive/refs/heads/main.zip
unzip -q main.zip unzip -q main.zip
mv soularr-main /opt/soularr mv soularr-main /opt/soularr
cd /opt/soularr cd /opt/soularr

View File

@ -15,9 +15,9 @@ update_os
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt-get install -y \ $STD apt-get install -y \
sudo \ sudo \
mc \ mc \
curl curl
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
# Fetching the latest Wazuh version # Fetching the latest Wazuh version
@ -26,15 +26,15 @@ RELEASE=$(curl -s https://api.github.com/repos/wazuh/wazuh/releases/latest | gre
msg_ok "Latest Wazuh Version: $RELEASE" msg_ok "Latest Wazuh Version: $RELEASE"
msg_info "Setup Wazuh" msg_info "Setup Wazuh"
wget -q https://packages.wazuh.com/$RELEASE/wazuh-install.sh curl -fsSL https://packages.wazuh.com/$RELEASE/wazuh-install.sh
chmod +x wazuh-install.sh chmod +x wazuh-install.sh
if [ "$STD" = "silent" ]; then if [ "$STD" = "silent" ]; then
bash wazuh-install.sh -a >> ~/wazuh-install.output bash wazuh-install.sh -a >>~/wazuh-install.output
else else
bash wazuh-install.sh -a | tee -a ~/wazuh-install.output bash wazuh-install.sh -a | tee -a ~/wazuh-install.output
fi fi
cat ~/wazuh-install.output | grep -E "User|Password" | awk '{$1=$1};1' | sed '1i wazuh-credentials' > ~/wazuh.creds cat ~/wazuh-install.output | grep -E "User|Password" | awk '{$1=$1};1' | sed '1i wazuh-credentials' >~/wazuh.creds
msg_ok "Setup Wazuh" msg_ok "Setup Wazuh"
motd_ssh motd_ssh

File diff suppressed because it is too large Load Diff

View File

@ -6,198 +6,198 @@
# This function sets color variables for formatting output in the terminal # This function sets color variables for formatting output in the terminal
color() { color() {
# Colors # Colors
YW=$(echo "\033[33m") YW=$(echo "\033[33m")
YWB=$(echo "\033[93m") YWB=$(echo "\033[93m")
BL=$(echo "\033[36m") BL=$(echo "\033[36m")
RD=$(echo "\033[01;31m") RD=$(echo "\033[01;31m")
GN=$(echo "\033[1;92m") GN=$(echo "\033[1;92m")
# Formatting # Formatting
CL=$(echo "\033[m") CL=$(echo "\033[m")
BFR="\\r\\033[K" BFR="\\r\\033[K"
BOLD=$(echo "\033[1m") BOLD=$(echo "\033[1m")
HOLD=" " HOLD=" "
TAB=" " TAB=" "
# System # System
RETRY_NUM=10 RETRY_NUM=10
RETRY_EVERY=3 RETRY_EVERY=3
# Icons # Icons
CM="${TAB}✔️${TAB}${CL}" CM="${TAB}✔️${TAB}${CL}"
CROSS="${TAB}✖️${TAB}${CL}" CROSS="${TAB}✖️${TAB}${CL}"
INFO="${TAB}💡${TAB}${CL}" INFO="${TAB}💡${TAB}${CL}"
NETWORK="${TAB}📡${TAB}${CL}" NETWORK="${TAB}📡${TAB}${CL}"
OS="${TAB}🖥️${TAB}${CL}" OS="${TAB}🖥️${TAB}${CL}"
OSVERSION="${TAB}🌟${TAB}${CL}" OSVERSION="${TAB}🌟${TAB}${CL}"
HOSTNAME="${TAB}🏠${TAB}${CL}" HOSTNAME="${TAB}🏠${TAB}${CL}"
GATEWAY="${TAB}🌐${TAB}${CL}" GATEWAY="${TAB}🌐${TAB}${CL}"
DEFAULT="${TAB}⚙️${TAB}${CL}" DEFAULT="${TAB}⚙️${TAB}${CL}"
} }
# Function to set STD mode based on verbosity # Function to set STD mode based on verbosity
set_std_mode() { set_std_mode() {
if [ "$VERBOSE" = "yes" ]; then if [ "$VERBOSE" = "yes" ]; then
STD="" STD=""
else else
STD="silent" STD="silent"
fi fi
} }
# Silent execution function # Silent execution function
silent() { silent() {
"$@" >/dev/null 2>&1 "$@" >/dev/null 2>&1
} }
# This function enables IPv6 if it's not disabled and sets verbose mode # This function enables IPv6 if it's not disabled and sets verbose mode
verb_ip6() { verb_ip6() {
set_std_mode # Set STD mode based on VERBOSE set_std_mode # Set STD mode based on VERBOSE
if [ "$DISABLEIPV6" == "yes" ]; then if [ "$DISABLEIPV6" == "yes" ]; then
echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf
$STD sysctl -p $STD sysctl -p
fi fi
} }
# This function sets error handling options and defines the error_handler function to handle errors # This function sets error handling options and defines the error_handler function to handle errors
catch_errors() { catch_errors() {
set -Eeuo pipefail set -Eeuo pipefail
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
} }
# This function handles errors # This function handles errors
error_handler() { error_handler() {
source <(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/api.func) source <(curl -fsSL - https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/api.func)
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi
printf "\e[?25h" printf "\e[?25h"
local exit_code="$?" local exit_code="$?"
local line_number="$1" local line_number="$1"
local command="$2" 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}" 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" echo -e "\n$error_message"
if [[ "$line_number" -eq 50 ]]; then if [[ "$line_number" -eq 50 ]]; then
echo -e "The silent function has suppressed the error, run the script with verbose mode enabled, which will provide more detailed output.\n" echo -e "The silent function has suppressed the error, run the script with verbose mode enabled, which will provide more detailed output.\n"
post_update_to_api "failed" "No error message, script ran in silent mode" post_update_to_api "failed" "No error message, script ran in silent mode"
else else
post_update_to_api "failed" "${command}" post_update_to_api "failed" "${command}"
fi fi
} }
# This function displays a spinner. # This function displays a spinner.
spinner() { spinner() {
local frames=('⠋' '⠙' '⠹' '⠸' '⠼' '⠴' '⠦' '⠧' '⠇' '⠏') local frames=('⠋' '⠙' '⠹' '⠸' '⠼' '⠴' '⠦' '⠧' '⠇' '⠏')
local spin_i=0 local spin_i=0
local interval=0.1 local interval=0.1
printf "\e[?25l" printf "\e[?25l"
local color="${YWB}" local color="${YWB}"
while true; do while true; do
printf "\r ${color}%s${CL}" "${frames[spin_i]}" printf "\r ${color}%s${CL}" "${frames[spin_i]}"
spin_i=$(((spin_i + 1) % ${#frames[@]})) spin_i=$(((spin_i + 1) % ${#frames[@]}))
sleep "$interval" sleep "$interval"
done done
} }
# This function displays an informational message with a yellow color. # This function displays an informational message with a yellow color.
msg_info() { msg_info() {
local msg="$1" local msg="$1"
echo -ne "${TAB}${YW}${HOLD}${msg}${HOLD}" echo -ne "${TAB}${YW}${HOLD}${msg}${HOLD}"
spinner & spinner &
SPINNER_PID=$! SPINNER_PID=$!
} }
# This function displays a success message with a green color. # This function displays a success message with a green color.
msg_ok() { msg_ok() {
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi
printf "\e[?25h" printf "\e[?25h"
local msg="$1" local msg="$1"
echo -e "${BFR}${CM}${GN}${msg}${CL}" echo -e "${BFR}${CM}${GN}${msg}${CL}"
} }
# This function displays a error message with a red color. # This function displays a error message with a red color.
msg_error() { msg_error() {
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi
printf "\e[?25h" printf "\e[?25h"
local msg="$1" local msg="$1"
echo -e "${BFR}${CROSS}${RD}${msg}${CL}" echo -e "${BFR}${CROSS}${RD}${msg}${CL}"
} }
# This function sets up the Container OS by generating the locale, setting the timezone, and checking the network connection # This function sets up the Container OS by generating the locale, setting the timezone, and checking the network connection
setting_up_container() { setting_up_container() {
msg_info "Setting up Container OS" msg_info "Setting up Container OS"
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
locale_line=$(grep -v '^#' /etc/locale.gen | grep -E '^[a-zA-Z]' | awk '{print $1}' | head -n 1) locale_line=$(grep -v '^#' /etc/locale.gen | grep -E '^[a-zA-Z]' | awk '{print $1}' | head -n 1)
echo "LANG=${locale_line}" >/etc/default/locale echo "LANG=${locale_line}" >/etc/default/locale
locale-gen >/dev/null locale-gen >/dev/null
export LANG=${locale_line} export LANG=${locale_line}
echo $tz >/etc/timezone echo $tz >/etc/timezone
ln -sf /usr/share/zoneinfo/$tz /etc/localtime ln -sf /usr/share/zoneinfo/$tz /etc/localtime
for ((i = RETRY_NUM; i > 0; i--)); do for ((i = RETRY_NUM; i > 0; i--)); do
if [ "$(hostname -I)" != "" ]; then if [ "$(hostname -I)" != "" ]; then
break 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 "${NETWORK}Check Network Settings"
exit 1
fi fi
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED echo 1>&2 -en "${CROSS}${RD} No Network! "
systemctl disable -q --now systemd-networkd-wait-online.service sleep $RETRY_EVERY
msg_ok "Set up Container OS" done
msg_ok "Network Connected: ${BL}$(hostname -I)" if [ "$(hostname -I)" = "" ]; then
echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
echo -e "${NETWORK}Check Network Settings"
exit 1
fi
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
systemctl disable -q --now systemd-networkd-wait-online.service
msg_ok "Set up Container OS"
msg_ok "Network Connected: ${BL}$(hostname -I)"
} }
# This function checks the network connection by pinging a known IP address and prompts the user to continue if the internet is not connected # This function checks the network connection by pinging a known IP address and prompts the user to continue if the internet is not connected
network_check() { network_check() {
set +e set +e
trap - ERR trap - ERR
ipv4_connected=false ipv4_connected=false
ipv6_connected=false ipv6_connected=false
sleep 1 sleep 1
# Check IPv4 connectivity to Google, Cloudflare & Quad9 DNS servers. # Check IPv4 connectivity to Google, Cloudflare & Quad9 DNS servers.
if ping -c 1 -W 1 1.1.1.1 &>/dev/null || ping -c 1 -W 1 8.8.8.8 &>/dev/null || ping -c 1 -W 1 9.9.9.9 &>/dev/null; then if ping -c 1 -W 1 1.1.1.1 &>/dev/null || ping -c 1 -W 1 8.8.8.8 &>/dev/null || ping -c 1 -W 1 9.9.9.9 &>/dev/null; then
msg_ok "IPv4 Internet Connected" msg_ok "IPv4 Internet Connected"
ipv4_connected=true ipv4_connected=true
else
msg_error "IPv4 Internet Not Connected"
fi
# Check IPv6 connectivity to Google, Cloudflare & Quad9 DNS servers.
if ping6 -c 1 -W 1 2606:4700:4700::1111 &>/dev/null || ping6 -c 1 -W 1 2001:4860:4860::8888 &>/dev/null || ping6 -c 1 -W 1 2620:fe::fe &>/dev/null; then
msg_ok "IPv6 Internet Connected"
ipv6_connected=true
else
msg_error "IPv6 Internet Not Connected"
fi
# If both IPv4 and IPv6 checks fail, prompt the user
if [[ $ipv4_connected == false && $ipv6_connected == false ]]; then
read -r -p "No Internet detected,would you like to continue anyway? <y/N> " prompt
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
echo -e "${INFO}${RD}Expect Issues Without Internet${CL}"
else else
msg_error "IPv4 Internet Not Connected" echo -e "${NETWORK}Check Network Settings"
exit 1
fi fi
fi
# Check IPv6 connectivity to Google, Cloudflare & Quad9 DNS servers. RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
if ping6 -c 1 -W 1 2606:4700:4700::1111 &>/dev/null || ping6 -c 1 -W 1 2001:4860:4860::8888 &>/dev/null || ping6 -c 1 -W 1 2620:fe::fe &>/dev/null; then if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
msg_ok "IPv6 Internet Connected" set -e
ipv6_connected=true trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
else
msg_error "IPv6 Internet Not Connected"
fi
# If both IPv4 and IPv6 checks fail, prompt the user
if [[ $ipv4_connected == false && $ipv6_connected == false ]]; then
read -r -p "No Internet detected,would you like to continue anyway? <y/N> " prompt
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
echo -e "${INFO}${RD}Expect Issues Without Internet${CL}"
else
echo -e "${NETWORK}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
} }
# This function updates the Container OS by running apt-get update and upgrade # This function updates the Container OS by running apt-get update and upgrade
update_os() { update_os() {
msg_info "Updating Container OS" msg_info "Updating Container OS"
if [[ "$CACHER" == "yes" ]]; then if [[ "$CACHER" == "yes" ]]; then
echo "Acquire::http::Proxy-Auto-Detect \"/usr/local/bin/apt-proxy-detect.sh\";" >/etc/apt/apt.conf.d/00aptproxy echo "Acquire::http::Proxy-Auto-Detect \"/usr/local/bin/apt-proxy-detect.sh\";" >/etc/apt/apt.conf.d/00aptproxy
cat <<EOF >/usr/local/bin/apt-proxy-detect.sh cat <<EOF >/usr/local/bin/apt-proxy-detect.sh
#!/bin/bash #!/bin/bash
if nc -w1 -z "${CACHER_IP}" 3142; then if nc -w1 -z "${CACHER_IP}" 3142; then
echo -n "http://${CACHER_IP}:3142" echo -n "http://${CACHER_IP}:3142"
@ -205,71 +205,71 @@ else
echo -n "DIRECT" echo -n "DIRECT"
fi fi
EOF EOF
chmod +x /usr/local/bin/apt-proxy-detect.sh chmod +x /usr/local/bin/apt-proxy-detect.sh
fi fi
$STD apt-get update $STD apt-get update
$STD apt-get -o Dpkg::Options::="--force-confold" -y dist-upgrade $STD apt-get -o Dpkg::Options::="--force-confold" -y dist-upgrade
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
msg_ok "Updated Container OS" msg_ok "Updated Container OS"
msg_info "Installing core dependencies" msg_info "Installing core dependencies"
$STD apt-get update $STD apt-get update
$STD apt-get install -y sudo curl mc $STD apt-get install -y sudo curl mc
msg_ok "Core dependencies installed" msg_ok "Core dependencies installed"
} }
# This function modifies the message of the day (motd) and SSH settings # This function modifies the message of the day (motd) and SSH settings
motd_ssh() { motd_ssh() {
grep -qxF "export TERM='xterm-256color'" /root/.bashrc || echo "export TERM='xterm-256color'" >>/root/.bashrc grep -qxF "export TERM='xterm-256color'" /root/.bashrc || echo "export TERM='xterm-256color'" >>/root/.bashrc
if [ -f "/etc/os-release" ]; then if [ -f "/etc/os-release" ]; then
OS_NAME=$(grep ^NAME /etc/os-release | cut -d= -f2 | tr -d '"') OS_NAME=$(grep ^NAME /etc/os-release | cut -d= -f2 | tr -d '"')
OS_VERSION=$(grep ^VERSION_ID /etc/os-release | cut -d= -f2 | tr -d '"') OS_VERSION=$(grep ^VERSION_ID /etc/os-release | cut -d= -f2 | tr -d '"')
elif [ -f "/etc/debian_version" ]; then elif [ -f "/etc/debian_version" ]; then
OS_NAME="Debian" OS_NAME="Debian"
OS_VERSION=$(cat /etc/debian_version) OS_VERSION=$(cat /etc/debian_version)
fi fi
PROFILE_FILE="/etc/profile.d/00_lxc-details.sh" PROFILE_FILE="/etc/profile.d/00_lxc-details.sh"
echo "echo -e \"\"" >"$PROFILE_FILE" echo "echo -e \"\"" >"$PROFILE_FILE"
echo -e "echo -e \"${BOLD}${YW}${APPLICATION} LXC Container - DEV Repository${CL}\"" >>"$PROFILE_FILE" echo -e "echo -e \"${BOLD}${YW}${APPLICATION} LXC Container - DEV Repository${CL}\"" >>"$PROFILE_FILE"
echo -e "echo -e \"${RD}WARNING: This is a DEVELOPMENT version (ProxmoxVED). Do NOT use in production!${CL}\"" >>"$PROFILE_FILE" echo -e "echo -e \"${RD}WARNING: This is a DEVELOPMENT version (ProxmoxVED). Do NOT use in production!${CL}\"" >>"$PROFILE_FILE"
echo -e "echo -e \"${YW} OS: ${GN}${OS_NAME} - Version: ${OS_VERSION}${CL}\"" >>"$PROFILE_FILE" echo -e "echo -e \"${YW} OS: ${GN}${OS_NAME} - Version: ${OS_VERSION}${CL}\"" >>"$PROFILE_FILE"
echo -e "echo -e \"${YW} Hostname: ${GN}\$(hostname)${CL}\"" >>"$PROFILE_FILE" echo -e "echo -e \"${YW} Hostname: ${GN}\$(hostname)${CL}\"" >>"$PROFILE_FILE"
echo -e "echo -e \"${YW} IP Address: ${GN}\$(hostname -I | awk '{print \$1}')${CL}\"" >>"$PROFILE_FILE" echo -e "echo -e \"${YW} IP Address: ${GN}\$(hostname -I | awk '{print \$1}')${CL}\"" >>"$PROFILE_FILE"
echo -e "echo -e \"${YW} Repository: ${GN}https://github.com/community-scripts/ProxmoxVED${CL}\"" >>"$PROFILE_FILE" echo -e "echo -e \"${YW} Repository: ${GN}https://github.com/community-scripts/ProxmoxVED${CL}\"" >>"$PROFILE_FILE"
echo "echo \"\"" >>"$PROFILE_FILE" echo "echo \"\"" >>"$PROFILE_FILE"
chmod -x /etc/update-motd.d/* chmod -x /etc/update-motd.d/*
if [[ "${SSH_ROOT}" == "yes" ]]; then if [[ "${SSH_ROOT}" == "yes" ]]; then
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd systemctl restart sshd
fi fi
} }
# This function customizes the container by modifying the getty service and enabling auto-login for the root user # This function customizes the container by modifying the getty service and enabling auto-login for the root user
customize() { customize() {
if [[ "$PASSWORD" == "" ]]; then if [[ "$PASSWORD" == "" ]]; then
msg_info "Customizing Container" msg_info "Customizing Container"
GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf" GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
mkdir -p $(dirname $GETTY_OVERRIDE) mkdir -p $(dirname $GETTY_OVERRIDE)
cat <<EOF >$GETTY_OVERRIDE cat <<EOF >$GETTY_OVERRIDE
[Service] [Service]
ExecStart= ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
EOF EOF
systemctl daemon-reload systemctl daemon-reload
systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//') systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
msg_ok "Customized Container" msg_ok "Customized Container"
fi fi
echo "bash -c \"\$(wget -qLO - https://github.com/community-scripts/ProxmoxVED/raw/main/ct/${app}.sh)\"" >/usr/bin/update echo "bash -c \"\$(curl -fsSL https://github.com/community-scripts/ProxmoxVED/raw/main/ct/${app}.sh)\"" >/usr/bin/update
chmod +x /usr/bin/update chmod +x /usr/bin/update
curl -fsSL
if [[ -n "${SSH_AUTHORIZED_KEY}" ]]; then if [[ -n "${SSH_AUTHORIZED_KEY}" ]]; then
mkdir -p /root/.ssh mkdir -p /root/.ssh
echo "${SSH_AUTHORIZED_KEY}" >/root/.ssh/authorized_keys echo "${SSH_AUTHORIZED_KEY}" >/root/.ssh/authorized_keys
chmod 700 /root/.ssh chmod 700 /root/.ssh
chmod 600 /root/.ssh/authorized_keys chmod 600 /root/.ssh/authorized_keys
fi fi
} }

View File

@ -5,8 +5,8 @@
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
function header_info { function header_info {
clear clear
cat <<"EOF" cat <<"EOF"
_______ __ ____ _______ __ ____
/ ____(_) /__ / __ )_________ _ __________ _____ / ____(_) /__ / __ )_________ _ __________ _____
/ /_ / / / _ \/ __ / ___/ __ \ | /| / / ___/ _ \/ ___/ / /_ / / / _ \/ __ / ___/ __ \ | /| / / ___/ _ \/ ___/
@ -36,67 +36,66 @@ IP=$(ip -4 addr show "$IFACE" | awk '/inet / {print $2}' | cut -d/ -f1 | head -n
[[ -z "$IP" ]] && IP=$(hostname -I | awk '{print $1}') [[ -z "$IP" ]] && IP=$(hostname -I | awk '{print $1}')
[[ -z "$IP" ]] && IP="127.0.0.1" [[ -z "$IP" ]] && IP="127.0.0.1"
# Detect OS # Detect OS
if [[ -f "/etc/alpine-release" ]]; then if [[ -f "/etc/alpine-release" ]]; then
OS="Alpine" OS="Alpine"
SERVICE_PATH="/etc/init.d/filebrowser" SERVICE_PATH="/etc/init.d/filebrowser"
PKG_MANAGER="apk add --no-cache" PKG_MANAGER="apk add --no-cache"
elif [[ -f "/etc/debian_version" ]]; then elif [[ -f "/etc/debian_version" ]]; then
OS="Debian" OS="Debian"
SERVICE_PATH="/etc/systemd/system/filebrowser.service" SERVICE_PATH="/etc/systemd/system/filebrowser.service"
PKG_MANAGER="apt-get install -y" PKG_MANAGER="apt-get install -y"
else else
echo -e "${CROSS} Unsupported OS detected. Exiting." echo -e "${CROSS} Unsupported OS detected. Exiting."
exit 1 exit 1
fi fi
header_info header_info
function msg_info() { function msg_info() {
local msg="$1" local msg="$1"
echo -e "${INFO} ${YW}${msg}...${CL}" echo -e "${INFO} ${YW}${msg}...${CL}"
} }
function msg_ok() { function msg_ok() {
local msg="$1" local msg="$1"
echo -e "${CM} ${GN}${msg}${CL}" echo -e "${CM} ${GN}${msg}${CL}"
} }
function msg_error() { function msg_error() {
local msg="$1" local msg="$1"
echo -e "${CROSS} ${RD}${msg}${CL}" echo -e "${CROSS} ${RD}${msg}${CL}"
} }
if [ -f "$INSTALL_PATH" ]; then if [ -f "$INSTALL_PATH" ]; then
echo -e "${YW}⚠️ ${APP} is already installed.${CL}" echo -e "${YW}⚠️ ${APP} is already installed.${CL}"
read -r -p "Would you like to uninstall ${APP}? (y/N): " uninstall_prompt read -r -p "Would you like to uninstall ${APP}? (y/N): " uninstall_prompt
if [[ "${uninstall_prompt,,}" =~ ^(y|yes)$ ]]; then if [[ "${uninstall_prompt,,}" =~ ^(y|yes)$ ]]; then
msg_info "Uninstalling ${APP}" msg_info "Uninstalling ${APP}"
if [[ "$OS" == "Debian" ]]; then if [[ "$OS" == "Debian" ]]; then
systemctl disable --now filebrowser.service &>/dev/null systemctl disable --now filebrowser.service &>/dev/null
rm -f "$SERVICE_PATH" rm -f "$SERVICE_PATH"
else
rc-service filebrowser stop &>/dev/null
rc-update del filebrowser &>/dev/null
rm -f "$SERVICE_PATH"
fi
rm -f "$INSTALL_PATH" "$DB_PATH"
msg_ok "${APP} has been uninstalled."
exit 0
fi
read -r -p "Would you like to update ${APP}? (y/N): " update_prompt
if [[ "${update_prompt,,}" =~ ^(y|yes)$ ]]; then
msg_info "Updating ${APP}"
wget -qO- https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz | tar -xzv -C /usr/local/bin &>/dev/null
chmod +x "$INSTALL_PATH"
msg_ok "Updated ${APP}"
exit 0
else else
echo -e "${YW}⚠️ Update skipped. Exiting.${CL}" rc-service filebrowser stop &>/dev/null
exit 0 rc-update del filebrowser &>/dev/null
rm -f "$SERVICE_PATH"
fi fi
rm -f "$INSTALL_PATH" "$DB_PATH"
msg_ok "${APP} has been uninstalled."
exit 0
fi
read -r -p "Would you like to update ${APP}? (y/N): " update_prompt
if [[ "${update_prompt,,}" =~ ^(y|yes)$ ]]; then
msg_info "Updating ${APP}"
curl -fsSL https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz | tar -xzv -C /usr/local/bin &>/dev/null
chmod +x "$INSTALL_PATH"
msg_ok "Updated ${APP}"
exit 0
else
echo -e "${YW}⚠️ Update skipped. Exiting.${CL}"
exit 0
fi
fi fi
echo -e "${YW}⚠️ ${APP} is not installed.${CL}" echo -e "${YW}⚠️ ${APP} is not installed.${CL}"
@ -105,43 +104,43 @@ PORT=${PORT:-$DEFAULT_PORT}
read -r -p "Would you like to install ${APP}? (y/n): " install_prompt read -r -p "Would you like to install ${APP}? (y/n): " install_prompt
if [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then if [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then
msg_info "Installing ${APP} on ${OS}" msg_info "Installing ${APP} on ${OS}"
$PKG_MANAGER wget tar curl &>/dev/null $PKG_MANAGER wget tar curl &>/dev/null
wget -qO- https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz | tar -xzv -C /usr/local/bin &>/dev/null curl -fsSL https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz | tar -xzv -C /usr/local/bin &>/dev/null
chmod +x "$INSTALL_PATH" chmod +x "$INSTALL_PATH"
msg_ok "Installed ${APP}" msg_ok "Installed ${APP}"
msg_info "Creating FileBrowser directory" msg_info "Creating FileBrowser directory"
mkdir -p /usr/local/community-scripts mkdir -p /usr/local/community-scripts
chown root:root /usr/local/community-scripts chown root:root /usr/local/community-scripts
chmod 755 /usr/local/community-scripts chmod 755 /usr/local/community-scripts
touch "$DB_PATH" touch "$DB_PATH"
chown root:root "$DB_PATH" chown root:root "$DB_PATH"
chmod 644 "$DB_PATH" chmod 644 "$DB_PATH"
msg_ok "Directory created successfully" msg_ok "Directory created successfully"
read -r -p "Would you like to use No Authentication? (y/N): " auth_prompt read -r -p "Would you like to use No Authentication? (y/N): " auth_prompt
if [[ "${auth_prompt,,}" =~ ^(y|yes)$ ]]; then if [[ "${auth_prompt,,}" =~ ^(y|yes)$ ]]; then
msg_info "Configuring No Authentication" msg_info "Configuring No Authentication"
cd /usr/local/community-scripts cd /usr/local/community-scripts
filebrowser config init -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null filebrowser config init -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null
filebrowser config set -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null filebrowser config set -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null
filebrowser config init --auth.method=noauth &>/dev/null filebrowser config init --auth.method=noauth &>/dev/null
filebrowser config set --auth.method=noauth &>/dev/null filebrowser config set --auth.method=noauth &>/dev/null
filebrowser users add ID 1 --perm.admin &>/dev/null filebrowser users add ID 1 --perm.admin &>/dev/null
msg_ok "No Authentication configured" msg_ok "No Authentication configured"
else else
msg_info "Setting up default authentication" msg_info "Setting up default authentication"
cd /usr/local/community-scripts cd /usr/local/community-scripts
filebrowser config init -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null filebrowser config init -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null
filebrowser config set -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null filebrowser config set -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null
filebrowser users add admin helper-scripts.com --perm.admin --database "$DB_PATH" &>/dev/null filebrowser users add admin helper-scripts.com --perm.admin --database "$DB_PATH" &>/dev/null
msg_ok "Default authentication configured (admin:helper-scripts.com)" msg_ok "Default authentication configured (admin:helper-scripts.com)"
fi fi
msg_info "Creating service" msg_info "Creating service"
if [[ "$OS" == "Debian" ]]; then if [[ "$OS" == "Debian" ]]; then
cat <<EOF > "$SERVICE_PATH" cat <<EOF >"$SERVICE_PATH"
[Unit] [Unit]
Description=Filebrowser Description=Filebrowser
After=network-online.target After=network-online.target
@ -157,9 +156,9 @@ Restart=always
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
systemctl enable -q --now filebrowser systemctl enable -q --now filebrowser
else else
cat <<EOF > "$SERVICE_PATH" cat <<EOF >"$SERVICE_PATH"
#!/sbin/openrc-run #!/sbin/openrc-run
command="/usr/local/bin/filebrowser" command="/usr/local/bin/filebrowser"
@ -172,14 +171,14 @@ depend() {
need net need net
} }
EOF EOF
chmod +x "$SERVICE_PATH" chmod +x "$SERVICE_PATH"
rc-update add filebrowser default &>/dev/null rc-update add filebrowser default &>/dev/null
rc-service filebrowser start &>/dev/null rc-service filebrowser start &>/dev/null
fi fi
msg_ok "Service created successfully" msg_ok "Service created successfully"
echo -e "${CM} ${GN}${APP} is reachable at: ${BL}http://$IP:$PORT${CL}" echo -e "${CM} ${GN}${APP} is reachable at: ${BL}http://$IP:$PORT${CL}"
else else
echo -e "${YW}⚠️ Installation skipped. Exiting.${CL}" echo -e "${YW}⚠️ Installation skipped. Exiting.${CL}"
exit 0 exit 0
fi fi

View File

@ -6,8 +6,8 @@
# https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE # https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
function header_info { function header_info {
clear clear
cat <<"EOF" cat <<"EOF"
____ _ __ ____ __ ____ _ __ ____ __
/ __/___(_)__ ____ _/ /____ / __/_ _____ ___ ___ ____/ /_ / __/___(_)__ ____ _/ /____ / __/_ _____ ___ ___ ____/ /_
/ _// __/ / _ `/ _ `/ __/ -_) _\ \/ // / _ \/ _ \/ _ \/ __/ __/ / _// __/ / _ `/ _ `/ __/ -_) _\ \/ // / _ \/ _ \/ _ \/ __/ __/
@ -28,11 +28,11 @@ header_info
# The array of device types # The array of device types
# CHAR_DEVS+=(major:minor) # CHAR_DEVS+=(major:minor)
CHAR_DEVS+=("1:1") # mem CHAR_DEVS+=("1:1") # mem
CHAR_DEVS+=("29:0") # fb0 CHAR_DEVS+=("29:0") # fb0
CHAR_DEVS+=("188:.*") # ttyUSB* CHAR_DEVS+=("188:.*") # ttyUSB*
CHAR_DEVS+=("189:.*") # bus/usb/* CHAR_DEVS+=("189:.*") # bus/usb/*
CHAR_DEVS+=("226:0") # card0 CHAR_DEVS+=("226:0") # card0
CHAR_DEVS+=("226:128") # renderD128 CHAR_DEVS+=("226:128") # renderD128
# Proccess char device string # Proccess char device string
@ -89,5 +89,5 @@ EOF
echo -e "\e[1;33m \nFinished....Reboot ${CTID} LXC to apply the changes.\n \e[0m" echo -e "\e[1;33m \nFinished....Reboot ${CTID} LXC to apply the changes.\n \e[0m"
# In the Proxmox web shell run # In the Proxmox web shell run
# bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVED/raw/main/misc/frigate-support.sh)" # bash -c "$(curl -fsSL - https://github.com/community-scripts/ProxmoxVED/raw/main/misc/frigate-support.sh)"
# Reboot the LXC to apply the changes # Reboot the LXC to apply the changes

View File

@ -5,7 +5,7 @@
# License: MIT # License: MIT
# https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE # https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
# Execute within the Proxmox shell # Execute within the Proxmox shell
# bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVED/raw/main/misc/hw-acceleration.sh)" # bash -c "$(curl -fsSL - https://github.com/community-scripts/ProxmoxVED/raw/main/misc/hw-acceleration.sh)"
set -e set -e
function header_info { function header_info {
@ -56,8 +56,8 @@ MSG_MAX_LENGTH=0
privileged_containers=$(pct list | awk 'NR>1 && system("grep -q \047unprivileged: 1\047 /etc/pve/lxc/" $1 ".conf")') privileged_containers=$(pct list | awk 'NR>1 && system("grep -q \047unprivileged: 1\047 /etc/pve/lxc/" $1 ".conf")')
if [ -z "$privileged_containers" ]; then if [ -z "$privileged_containers" ]; then
whiptail --msgbox "No Privileged Containers Found." 10 58 whiptail --msgbox "No Privileged Containers Found." 10 58
exit exit
fi fi
while read -r TAG ITEM; do while read -r TAG ITEM; do
@ -69,11 +69,11 @@ done < <(echo "$privileged_containers")
privileged_container=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Privileged Containers on $NODE" --checklist "\nSelect a Container To Add Intel HW Acceleration:\n" 16 $((MSG_MAX_LENGTH + 23)) 6 "${PREV_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit privileged_container=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Privileged Containers on $NODE" --checklist "\nSelect a Container To Add Intel HW Acceleration:\n" 16 $((MSG_MAX_LENGTH + 23)) 6 "${PREV_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
header_info header_info
read -r -p "Verbose mode? <y/N> " prompt read -r -p "Verbose mode? <y/N> " prompt
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
STD="" STD=""
else else
STD="silent" STD="silent"
fi fi
header_info header_info
cat <<EOF >>/etc/pve/lxc/${privileged_container}.conf cat <<EOF >>/etc/pve/lxc/${privileged_container}.conf

View File

@ -4,8 +4,8 @@
# Author: MickLesk (CanbiZ) # Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE # License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
source /dev/stdin <<< $(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/api.func) source /dev/stdin <<< $(curl -fsSL - https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/api.func)
source /dev/stdin <<< $(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/helpers.func) source /dev/stdin <<< $(curl -fsSL - https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/helpers.func)
function header_info { function header_info {
clear clear
@ -323,7 +323,7 @@ msg_info "Retrieving the URL for the Debian 12 Qcow2 Disk Image"
URL=https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-amd64.qcow2 URL=https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-amd64.qcow2
sleep 2 sleep 2
msg_ok "${CL}${BL}${URL}${CL}" msg_ok "${CL}${BL}${URL}${CL}"
wget -q --show-progress $URL curl -fL --progress-bar "$URL" -O
echo -en "\e[1A\e[0K" echo -en "\e[1A\e[0K"
FILE=$(basename $URL) FILE=$(basename $URL)
msg_ok "Downloaded ${CL}${BL}${FILE}${CL}" msg_ok "Downloaded ${CL}${BL}${FILE}${CL}"

View File

@ -4,7 +4,7 @@
# Author: MickLesk (CanbiZ) # Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE # License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
source /dev/stdin <<< $(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/api.func) source /dev/stdin <<<$(curl -fsSL - https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/api.func)
function header_info { function header_info {
clear clear
@ -63,7 +63,7 @@ THIN="discard=on,ssd=1,"
set -e set -e
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
trap cleanup EXIT trap cleanup EXIT
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM
function error_handler() { function error_handler() {
local exit_code="$?" local exit_code="$?"
@ -93,7 +93,7 @@ pushd $TEMP_DIR >/dev/null
if whiptail --backtitle "Proxmox VE Helper Scripts" --title "Debian 12 VM" --yesno "This will create a New Debian 12 VM. Proceed?" 10 58; then if whiptail --backtitle "Proxmox VE Helper Scripts" --title "Debian 12 VM" --yesno "This will create a New Debian 12 VM. Proceed?" 10 58; then
: :
else else
header_info && echo -e "${CROSS}${RD}User exited script${CL}\n" && exit header_info && echo -e "${CROSS}${RD}User exited script${CL}\n" && exit
fi fi
function msg_info() { function msg_info() {
@ -122,7 +122,7 @@ function check_root() {
} }
function pve_check() { function pve_check() {
if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[0-9]+)*"; then if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[0-9]+)*"; then
msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported"
echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
echo -e "Exiting..." echo -e "Exiting..."
@ -227,7 +227,7 @@ function advanced_settings() {
else else
exit-script exit-script
fi fi
if DISK_SIZE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Disk Size in GiB (e.g., 10, 20)" 8 58 "$DISK_SIZE" --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then if DISK_SIZE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Disk Size in GiB (e.g., 10, 20)" 8 58 "$DISK_SIZE" --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
DISK_SIZE=$(echo "$DISK_SIZE" | tr -d ' ') DISK_SIZE=$(echo "$DISK_SIZE" | tr -d ' ')
if [[ "$DISK_SIZE" =~ ^[0-9]+$ ]]; then if [[ "$DISK_SIZE" =~ ^[0-9]+$ ]]; then
@ -425,7 +425,7 @@ msg_info "Retrieving the URL for the Debian 12 Qcow2 Disk Image"
URL=https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-amd64.qcow2 URL=https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-amd64.qcow2
sleep 2 sleep 2
msg_ok "${CL}${BL}${URL}${CL}" msg_ok "${CL}${BL}${URL}${CL}"
wget -q --show-progress $URL curl -fL --progress-bar "$URL" -O
echo -en "\e[1A\e[0K" echo -en "\e[1A\e[0K"
FILE=$(basename $URL) FILE=$(basename $URL)
msg_ok "Downloaded ${CL}${BL}${FILE}${CL}" msg_ok "Downloaded ${CL}${BL}${FILE}${CL}"
@ -476,7 +476,7 @@ DESCRIPTION=$(
<img src='https://img.shields.io/badge/&#x2615;-Buy us a coffee-blue' alt='spend Coffee' /> <img src='https://img.shields.io/badge/&#x2615;-Buy us a coffee-blue' alt='spend Coffee' />
</a> </a>
</p> </p>
<span style='margin: 0 10px;'> <span style='margin: 0 10px;'>
<i class="fa fa-github fa-fw" style="color: #f5f5f5;"></i> <i class="fa fa-github fa-fw" style="color: #f5f5f5;"></i>
<a href='https://github.com/community-scripts/ProxmoxVE' target='_blank' rel='noopener noreferrer' style='text-decoration: none; color: #00617f;'>GitHub</a> <a href='https://github.com/community-scripts/ProxmoxVE' target='_blank' rel='noopener noreferrer' style='text-decoration: none; color: #00617f;'>GitHub</a>
@ -494,12 +494,12 @@ EOF
) )
qm set "$VMID" -description "$DESCRIPTION" >/dev/null qm set "$VMID" -description "$DESCRIPTION" >/dev/null
if [ -n "$DISK_SIZE" ]; then if [ -n "$DISK_SIZE" ]; then
msg_info "Resizing disk to $DISK_SIZE GB" msg_info "Resizing disk to $DISK_SIZE GB"
qm resize $VMID scsi0 ${DISK_SIZE} >/dev/null qm resize $VMID scsi0 ${DISK_SIZE} >/dev/null
else else
msg_info "Using default disk size of $DEFAULT_DISK_SIZE GB" msg_info "Using default disk size of $DEFAULT_DISK_SIZE GB"
qm resize $VMID scsi0 ${DEFAULT_DISK_SIZE} >/dev/null qm resize $VMID scsi0 ${DEFAULT_DISK_SIZE} >/dev/null
fi fi
msg_ok "Created a Debian 12 VM ${CL}${BL}(${HN})" msg_ok "Created a Debian 12 VM ${CL}${BL}(${HN})"
if [ "$START_VM" == "yes" ]; then if [ "$START_VM" == "yes" ]; then