Skip to content

Commit 415703e

Browse files
Merge pull request #116 from bashclub/dev
Dev
2 parents 954dc0d + 1a3d299 commit 415703e

File tree

3 files changed

+51
-5
lines changed

3 files changed

+51
-5
lines changed

install.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ if [ $ctid -gt 99 ]; then
119119
LXC_CHK=$ctid
120120
else
121121
# Get next free LXC-number
122-
LXC_LST=$( lxc-ls -1 | tail -1 )
123-
LXC_CHK=$((LXC_LST+1));
122+
LXC_CHK=$(($(pct list | cut -d' ' -f1 | tail -1) + 1))
124123
fi
125124

126125
if [ $LXC_CHK -lt 100 ] || [ -f /etc/pve/qemu-server/$LXC_CHK.conf ]; then
@@ -160,9 +159,11 @@ sleep 2
160159

161160
if [ $LXC_MP -gt 0 ]; then
162161
pct set $LXC_NBR -mp0 $LXC_SHAREFS_STORAGE:$LXC_SHAREFS_SIZE,backup=1,mp=/$LXC_SHAREFS_MOUNTPOINT
163-
pool=$(grep -A 4 $LXC_SHAREFS_STORAGE /etc/pve/storage.cfg | grep -m1 "pool " | cut -d ' ' -f2)
164-
dataset=$(grep mp0 /etc/pve/lxc/$LXC_NBR.conf | cut -d ':' -f3 | cut -d',' -f1)
165-
zfs set recordsize=$LXC_MP_RECORDSIZE $pool/$dataset
162+
if [[ "$(pvesm status | grep $LXC_SHAREFS_STORAGE | cut -d ' ' -f6)" == "zfspool" ]]; then
163+
pool=$(grep -A 4 $LXC_SHAREFS_STORAGE /etc/pve/storage.cfg | grep -m1 "pool " | cut -d ' ' -f2)
164+
dataset=$(grep mp0 /etc/pve/lxc/$LXC_NBR.conf | cut -d ':' -f3 | cut -d',' -f1)
165+
zfs set recordsize=$LXC_MP_RECORDSIZE $pool/$dataset
166+
fi
166167
fi
167168

168169
sleep 2;
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
# Authors:
4+
# (C) 2024 Thorsten Spille <[email protected]>
5+
6+
# This file contains the project constants on service level
7+
8+
# Debian Version, which will be installed
9+
LXC_TEMPLATE_VERSION="debian-12-standard"
10+
11+
# Create sharefs mountpoint
12+
LXC_MP=1
13+
# Defines the mountpoint of the filesystem shared by Zamba inside your LXC container (default: tank)
14+
LXC_SHAREFS_MOUNTPOINT="home"
15+
# Defines the recordsize of mp0
16+
LXC_MP_RECORDSIZE="16K"
17+
18+
# Create unprivileged container
19+
LXC_UNPRIVILEGED="1"
20+
21+
# enable nesting feature
22+
LXC_NESTING="1"
23+
24+
# enable keyctl feature
25+
LXC_KEYCTL="0"
26+
27+
# Sets the minimum amount of RAM the service needs for operation
28+
LXC_MEM_MIN=2048
29+
30+
# service dependent meta tags
31+
SERVICE_TAGS="php-fpm,nginx,mariadb"

src/cloudpanel/install-service.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
# Author:
4+
# (C) 2024 Thorsten Spille <[email protected]>
5+
6+
set -euo pipefail
7+
8+
source zamba.conf
9+
10+
wget -O - https://apt.bashclub.org/gpg/bashclub.pub | gpg --dearmor > /usr/share/keyrings/bashclub-keyring.gpg
11+
12+
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh
13+
echo "2aefee646f988877a31198e0d84ed30e2ef7a454857b606608a1f0b8eb6ec6b6 install.sh" | sha256sum -c
14+
DB_ENGINE=MARIADB_10.11 SWAP=false bash install.sh

0 commit comments

Comments
 (0)