mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-08 16:59:17 +00:00
Compare commits
1 Commits
6bc7cf6fcb
...
909090513d
Author | SHA1 | Date | |
---|---|---|---|
|
909090513d |
10
CHANGELOG.md
10
CHANGELOG.md
@ -20,16 +20,6 @@ Do not break established syntax in this file, as it is automatically updated by
|
||||
|
||||
### 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
|
||||
|
||||
### Changed
|
||||
|
@ -82,4 +82,4 @@ description
|
||||
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9000/if/flow/initial-setup/${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}/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 default_transaction_isolation TO 'read committed';"
|
||||
$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/^DBUser=.*/DBUser=$DB_USER/" /etc/zabbix/zabbix_server.conf
|
||||
sed -i "s/^# DBPassword=.*/DBPassword=$DB_PASS/" /etc/zabbix/zabbix_server.conf
|
||||
|
@ -157,76 +157,30 @@ arch_check() {
|
||||
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.
|
||||
header_info() {
|
||||
# Check if figlet is installed
|
||||
if ! command -v figlet &> /dev/null; then
|
||||
echo -e "${INFO}${BOLD}${DGN}Figlet for ASCII-Header not found. Installing... ${CL}"
|
||||
|
||||
# Install necessary dependencies and figlet
|
||||
if [ -f /etc/debian_version ] || [ -f /etc/lsb-release ]; then
|
||||
if [ -f /etc/debian_version ]; then
|
||||
# Debian/Ubuntu
|
||||
if ! grep -q "^deb http://ftp.debian.org/debian bookworm main contrib" /etc/apt/sources.list; then
|
||||
echo "deb http://ftp.debian.org/debian bookworm main contrib" >> /etc/apt/sources.list
|
||||
apt-get update -y &> /dev/null
|
||||
apt-get install -y tar build-essential &> /dev/null
|
||||
elif [ -f /etc/alpine-release ]; then
|
||||
apk add --no-cache tar build-base &> /dev/null
|
||||
export TERM=xterm
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
temp_dir=$(mktemp -d)
|
||||
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"
|
||||
apt-get install -y figlet &> /dev/null
|
||||
elif [ -f /etc/alpine-release ]; then
|
||||
# Alpine Linux
|
||||
apk add --no-cache figlet ncurses &> /dev/null
|
||||
export TERM=xterm
|
||||
else
|
||||
echo "Unsupported OS"
|
||||
return 1
|
||||
fi
|
||||
term_width=$(tput cols 2>/dev/null || echo 120)
|
||||
|
||||
term_width=$(tput cols 2>/dev/null || echo 120) # Fallback to 120 columns
|
||||
ascii_art=$(figlet -f slant -w "$term_width" "$APP")
|
||||
clear
|
||||
echo "$ascii_art"
|
||||
cat <<EOF
|
||||
$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.
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user