Compare commits

...

12 Commits

Author SHA1 Message Date
CanbiZ
10a7b17e83
Merge pull request #56 from havardthom/remove-action
Remove unnecessary code
2024-11-04 17:54:10 +01:00
Håvard Thom
af9f103e52 Remove unnecessary code 2024-11-04 17:48:41 +01:00
CanbiZ
a5462367a3
Update CHANGELOG.md
Signed-off-by: CanbiZ <47820557+MickLesk@users.noreply.github.com>
2024-11-04 17:24:42 +01:00
CanbiZ
c6fddcd752
Merge pull request #55 from MickLesk/main
Add Script for "Update" Command in Repo
2024-11-04 17:21:26 +01:00
CanbiZ
e0dbe419da Update update-repo.sh 2024-11-04 17:11:00 +01:00
CanbiZ
c290c10083 Update update-repo.sh 2024-11-04 17:09:45 +01:00
CanbiZ
56334616dc Update update-repo.sh 2024-11-04 17:08:07 +01:00
CanbiZ
90c5f1c2eb Merge branch 'main' of https://github.com/MickLesk/ProxmoxVE 2024-11-04 17:02:29 +01:00
CanbiZ
14d2386717 Add Script to Refresh Repositories (Update) 2024-11-04 17:01:47 +01:00
CanbiZ
0f2a1fdb45
Create check-script.yml
Signed-off-by: CanbiZ <47820557+MickLesk@users.noreply.github.com>
2024-11-04 16:14:49 +01:00
CanbiZ
fab6cfc6cd
Create pr-review.yml
Signed-off-by: CanbiZ <47820557+MickLesk@users.noreply.github.com>
2024-11-04 16:07:38 +01:00
CanbiZ
a95fc2d07d
Update pull_request_template.md
Signed-off-by: CanbiZ <47820557+MickLesk@users.noreply.github.com>
2024-11-04 15:57:46 +01:00
4 changed files with 138 additions and 2 deletions

54
.github/check-script.yml vendored Normal file
View 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

View File

@ -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

View File

@ -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
View 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"