mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-08 16:59:17 +00:00
Compare commits
9 Commits
909090513d
...
6bc7cf6fcb
Author | SHA1 | Date | |
---|---|---|---|
|
6bc7cf6fcb | ||
|
938f0f76fa | ||
|
611a14b55f | ||
|
304db812a8 | ||
|
678206768c | ||
|
92d2e421ee | ||
|
fe3ff916b6 | ||
|
d4c95779bf | ||
|
8c0794c2bb |
10
CHANGELOG.md
10
CHANGELOG.md
@ -20,6 +20,16 @@ Do not break established syntax in this file, as it is automatically updated by
|
|||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
### 💥 Breaking Changes
|
||||||
|
|
||||||
|
- Add Figlet into Repo | Creation of local ASCII Header [@MickLesk](https://github.com/MickLesk) ([#1072](https://github.com/community-scripts/ProxmoxVE/pull/1072))
|
||||||
|
- Add an IP-Update for MOTD if IP Changed [@MickLesk](https://github.com/MickLesk) ([#1067](https://github.com/community-scripts/ProxmoxVE/pull/1067))
|
||||||
|
|
||||||
|
### 🚀 Updated Scripts
|
||||||
|
|
||||||
|
- Zabbix: Fix SQL Path for 7.2 [@MickLesk](https://github.com/MickLesk) ([#1069](https://github.com/community-scripts/ProxmoxVE/pull/1069))
|
||||||
|
- Authentik: added missing port to access url [@TheRealVira](https://github.com/TheRealVira) ([#1065](https://github.com/community-scripts/ProxmoxVE/pull/1065))
|
||||||
|
|
||||||
## 2024-12-27
|
## 2024-12-27
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -82,4 +82,4 @@ description
|
|||||||
|
|
||||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}/if/flow/initial-setup/${CL}"
|
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9000/if/flow/initial-setup/${CL}"
|
||||||
|
@ -39,7 +39,7 @@ $STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCO
|
|||||||
$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 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'"
|
||||||
zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u $DB_USER psql $DB_NAME &>/dev/null
|
zcat /usr/share/zabbix/sql-scripts/postgresql/server.sql.gz | sudo -u $DB_USER psql $DB_NAME &>/dev/null
|
||||||
sed -i "s/^DBName=.*/DBName=$DB_NAME/" /etc/zabbix/zabbix_server.conf
|
sed -i "s/^DBName=.*/DBName=$DB_NAME/" /etc/zabbix/zabbix_server.conf
|
||||||
sed -i "s/^DBUser=.*/DBUser=$DB_USER/" /etc/zabbix/zabbix_server.conf
|
sed -i "s/^DBUser=.*/DBUser=$DB_USER/" /etc/zabbix/zabbix_server.conf
|
||||||
sed -i "s/^# DBPassword=.*/DBPassword=$DB_PASS/" /etc/zabbix/zabbix_server.conf
|
sed -i "s/^# DBPassword=.*/DBPassword=$DB_PASS/" /etc/zabbix/zabbix_server.conf
|
||||||
|
@ -157,30 +157,76 @@ arch_check() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to get the current IP address based on the distribution
|
||||||
|
get_current_ip() {
|
||||||
|
if [ -f /etc/os-release ]; then
|
||||||
|
# Check for Debian/Ubuntu (uses hostname -I)
|
||||||
|
if grep -qE 'ID=debian|ID=ubuntu' /etc/os-release; then
|
||||||
|
CURRENT_IP=$(hostname -I | awk '{print $1}')
|
||||||
|
# Check for Alpine (uses ip command)
|
||||||
|
elif grep -q 'ID=alpine' /etc/os-release; then
|
||||||
|
CURRENT_IP=$(ip -4 addr show eth0 | awk '/inet / {print $2}' | cut -d/ -f1 | head -n 1)
|
||||||
|
else
|
||||||
|
CURRENT_IP="Unknown"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo "$CURRENT_IP"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to update the IP address in the MOTD file
|
||||||
|
update_motd_ip() {
|
||||||
|
MOTD_FILE="/etc/motd"
|
||||||
|
|
||||||
|
if [ -f "$MOTD_FILE" ]; then
|
||||||
|
# Remove existing IP Address lines to prevent duplication
|
||||||
|
sed -i '/IP Address:/d' "$MOTD_FILE"
|
||||||
|
|
||||||
|
IP=$(get_current_ip)
|
||||||
|
# Add the new IP address
|
||||||
|
echo -e "${TAB}${NETWORK}${YW} IP Address: ${GN}${IP}${CL}" >> "$MOTD_FILE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# This function sets the APP-Name into an ASCII Header in Slant, figlet needed on proxmox main node.
|
# This function sets the APP-Name into an ASCII Header in Slant, figlet needed on proxmox main node.
|
||||||
header_info() {
|
header_info() {
|
||||||
if [ -f /etc/debian_version ]; then
|
# Check if figlet is installed
|
||||||
# Debian/Ubuntu
|
if ! command -v figlet &> /dev/null; then
|
||||||
if ! grep -q "^deb http://ftp.debian.org/debian bookworm main contrib" /etc/apt/sources.list; then
|
echo -e "${INFO}${BOLD}${DGN}Figlet for ASCII-Header not found. Installing... ${CL}"
|
||||||
echo "deb http://ftp.debian.org/debian bookworm main contrib" >> /etc/apt/sources.list
|
|
||||||
|
# Install necessary dependencies and figlet
|
||||||
|
if [ -f /etc/debian_version ] || [ -f /etc/lsb-release ]; then
|
||||||
apt-get update -y &> /dev/null
|
apt-get update -y &> /dev/null
|
||||||
fi
|
apt-get install -y tar build-essential &> /dev/null
|
||||||
apt-get install -y figlet &> /dev/null
|
|
||||||
elif [ -f /etc/alpine-release ]; then
|
elif [ -f /etc/alpine-release ]; then
|
||||||
# Alpine Linux
|
apk add --no-cache tar build-base &> /dev/null
|
||||||
apk add --no-cache figlet ncurses &> /dev/null
|
|
||||||
export TERM=xterm
|
export TERM=xterm
|
||||||
else
|
else
|
||||||
echo "Unsupported OS"
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
temp_dir=$(mktemp -d)
|
||||||
term_width=$(tput cols 2>/dev/null || echo 120) # Fallback to 120 columns
|
curl -sL https://github.com/community-scripts/ProxmoxVE/raw/refs/heads/main/misc/figlet.tar.xz -o "$temp_dir/figlet.tar.xz"
|
||||||
|
mkdir -p /tmp/figlet
|
||||||
|
tar -xf "$temp_dir/figlet.tar.xz" -C /tmp/figlet --strip-components=1
|
||||||
|
cd /tmp/figlet
|
||||||
|
# Run make to compile the figlet binary
|
||||||
|
make >/dev/null
|
||||||
|
# Check if the figlet binary exists
|
||||||
|
if [ -f "figlet" ]; then
|
||||||
|
chmod +x figlet
|
||||||
|
# Move figlet to /usr/local/bin if not already there
|
||||||
|
if [ ! -e /usr/local/bin/figlet ]; then
|
||||||
|
mv figlet /usr/local/bin/
|
||||||
|
mkdir -p /usr/local/share/figlet
|
||||||
|
cp -r /tmp/figlet/fonts/*.flf /usr/local/share/figlet/
|
||||||
|
fi
|
||||||
|
echo -e "${CM}${BOLD}${DGN}Figlet successfully installed. ${CL}"
|
||||||
|
fi
|
||||||
|
rm -rf "$temp_dir"
|
||||||
|
fi
|
||||||
|
term_width=$(tput cols 2>/dev/null || echo 120)
|
||||||
ascii_art=$(figlet -f slant -w "$term_width" "$APP")
|
ascii_art=$(figlet -f slant -w "$term_width" "$APP")
|
||||||
clear
|
clear
|
||||||
cat <<EOF
|
echo "$ascii_art"
|
||||||
$ascii_art
|
|
||||||
EOF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# This function checks if the script is running through SSH and prompts the user to confirm if they want to proceed or exit.
|
# This function checks if the script is running through SSH and prompts the user to confirm if they want to proceed or exit.
|
||||||
|
BIN
misc/figlet.tar.xz
Normal file
BIN
misc/figlet.tar.xz
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user