mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-10 17:59:17 +00:00
Compare commits
12 Commits
2fe24389d7
...
10a7b17e83
Author | SHA1 | Date | |
---|---|---|---|
|
10a7b17e83 | ||
|
af9f103e52 | ||
|
a5462367a3 | ||
|
c6fddcd752 | ||
|
e0dbe419da | ||
|
c290c10083 | ||
|
56334616dc | ||
|
90c5f1c2eb | ||
|
14d2386717 | ||
|
0f2a1fdb45 | ||
|
fab6cfc6cd | ||
|
a95fc2d07d |
54
.github/check-script.yml
vendored
Normal file
54
.github/check-script.yml
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
name: Check Shell Scripts
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '**/*.sh' # Führt den Check nur für Shell-Skripte aus
|
||||
|
||||
jobs:
|
||||
check-scripts:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Check `source` Line in Scripts
|
||||
shell: bash
|
||||
run: |
|
||||
set -e
|
||||
ERROR_COUNT=0
|
||||
FILES=$(find . -name "*.sh")
|
||||
|
||||
for FILE in $FILES; do
|
||||
# Check for exact match of the source line in line 2
|
||||
if [[ $(sed -n '2p' "$FILE") =~ ^source[[:space:]]+<(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) ]]; then
|
||||
echo "Check passed for: $FILE"
|
||||
else
|
||||
echo "Error in $FILE: Line 2 must be exactly 'source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)' if a source line is used."
|
||||
ERROR_COUNT=$((ERROR_COUNT + 1))
|
||||
fi
|
||||
|
||||
# Check for shebang line at the top
|
||||
if [[ $(head -n 1 "$FILE") != "#!/usr/bin/env bash" ]]; then
|
||||
echo "Error in $FILE: The first line must be '#!/usr/bin/env bash'."
|
||||
ERROR_COUNT=$((ERROR_COUNT + 1))
|
||||
fi
|
||||
|
||||
# Check for executable permissions
|
||||
if [[ ! -x "$FILE" ]]; then
|
||||
echo "Warning in $FILE: This script is not executable. Consider running 'chmod +x $FILE'."
|
||||
fi
|
||||
|
||||
# Check for empty lines at the beginning of the script
|
||||
if [[ $(head -n 10 "$FILE" | grep -c '^$') -gt 0 ]]; then
|
||||
echo "Warning in $FILE: There are empty lines at the beginning of the script. Consider removing them."
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ "$ERROR_COUNT" -gt 0 ]]; then
|
||||
echo "$ERROR_COUNT script(s) failed validation."
|
||||
exit 1
|
||||
else
|
||||
echo "All scripts passed."
|
||||
fi
|
13
.github/pull_request_template.md
vendored
13
.github/pull_request_template.md
vendored
@ -1,5 +1,5 @@
|
||||
> [!NOTE]
|
||||
We are meticulous when it comes to merging code into the main branch, so please understand that we may reject pull requests that do not meet the project's standards. It's never personal. Also, game-related scripts have a lower chance of being merged.
|
||||
> We are meticulous when it comes to merging code into the main branch, so please understand that we may reject pull requests that do not meet the project's standards. It's never personal. Also, game-related scripts have a lower chance of being merged.
|
||||
|
||||
## Description
|
||||
|
||||
@ -8,7 +8,6 @@ Provide a summary of the changes made and/or reference the issue being addressed
|
||||
Fixes # (issue)
|
||||
|
||||
## Type of change
|
||||
|
||||
Please check the relevant option(s):
|
||||
|
||||
- [ ] Bug fix (non-breaking change that resolves an issue)
|
||||
@ -18,3 +17,13 @@ Please check the relevant option(s):
|
||||
- [ ] Self-review performed (I have reviewed my code, ensuring it follows established patterns and conventions)
|
||||
- [ ] Documentation update required (this change requires an update to the documentation)
|
||||
|
||||
## Additional Information (optional)
|
||||
Provide any additional context or screenshots about the feature or fix here.
|
||||
|
||||
|
||||
## Related Pull Requests / Discussions
|
||||
|
||||
If there are other pull requests or discussions related to this change, please link them here:
|
||||
- Related PR #1
|
||||
- Related PR #2
|
||||
|
||||
|
@ -13,6 +13,14 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
> [!NOTE]
|
||||
All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment.
|
||||
|
||||
## 2024-11-04
|
||||
|
||||
### Breaking Change
|
||||
- **Automatic Update of Repository:** The update function now uses the new repository `community-scripts/ProxmoxVE` for Debian/Ubuntu LXC containers.
|
||||
|
||||
```bash
|
||||
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/update-repo.sh)"
|
||||
|
||||
## 2024-10-27
|
||||
|
||||
### Changed
|
||||
|
65
misc/update-repo.sh
Normal file
65
misc/update-repo.sh
Normal file
@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2024 tteck
|
||||
# Author: MickLesk
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
__ __ __ __ ____
|
||||
/ / / /___ ____/ /___ _/ /____ / __ \___ ____ ____
|
||||
/ / / / __ \/ __ / __ `/ __/ _ \ / /_/ / _ \/ __ \/ __ \
|
||||
/ /_/ / /_/ / /_/ / /_/ / /_/ __/ / _, _/ __/ /_/ / /_/ /
|
||||
\____/ .___/\__,_/\__,_/\__/\___/ /_/ |_|\___/ .___/\____/
|
||||
/_/ /_/
|
||||
EOF
|
||||
}
|
||||
|
||||
set -eEuo pipefail
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
|
||||
header_info
|
||||
echo "Loading..."
|
||||
NODE=$(hostname)
|
||||
|
||||
function update_container() {
|
||||
container=$1
|
||||
os=$(pct config "$container" | awk '/^ostype/ {print $2}')
|
||||
|
||||
if [[ "$os" == "ubuntu" || "$os" == "debian" ]]; then
|
||||
echo -e "${BL}[Info]${GN} Checking /usr/bin/update in ${BL}$container${CL} (OS: ${GN}$os${CL})"
|
||||
|
||||
if pct exec "$container" -- [ -e /usr/bin/update ]; then
|
||||
if pct exec "$container" -- grep -q "community-scripts/ProxmoxVE" /usr/bin/update; then
|
||||
echo -e "${RD}[No Change]${CL} /usr/bin/update is already up to date in ${BL}$container${CL}.\n"
|
||||
elif pct exec "$container" -- grep -q "tteck" /usr/bin/update; then
|
||||
echo -e "${RD}[Warning]${CL} /usr/bin/update in ${BL}$container${CL} contains a different entry (${RD}tteck${CL}). No changes made.\n"
|
||||
else
|
||||
pct exec "$container" -- bash -c "sed -i 's/tteck\\/Proxmox/community-scripts\\/ProxmoxVE/g' /usr/bin/update"
|
||||
|
||||
if pct exec "$container" -- grep -q "community-scripts/ProxmoxVE" /usr/bin/update; then
|
||||
echo -e "${GN}[Success]${CL} /usr/bin/update updated in ${BL}$container${CL}.\n"
|
||||
else
|
||||
echo -e "${RD}[Error]${CL} /usr/bin/update in ${BL}$container${CL} could not be updated properly.\n"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo -e "${RD}[Error]${CL} /usr/bin/update not found in container ${BL}$container${CL}.\n"
|
||||
fi
|
||||
else
|
||||
echo -e "${BL}[Info]${GN} Skipping ${BL}$container${CL} (not Debian/Ubuntu)\n"
|
||||
fi
|
||||
}
|
||||
|
||||
header_info
|
||||
for container in $(pct list | awk '{if(NR>1) print $1}'); do
|
||||
update_container "$container"
|
||||
done
|
||||
|
||||
header_info
|
||||
echo -e "${GN}The process is complete. The repositories have been switched to community-scripts/ProxmoxVE.${CL}\n"
|
Loading…
Reference in New Issue
Block a user