Compare commits

..
2 Commits
Author SHA256 Message Date
spacefreak 0ade18796f cleanup source 2026-08-27 23:39:46 +02:00
spacefreak 0f61e177f8 allow installation of a specific tag/branch by exporting PBC_GIT_TAG 2026-08-27 23:29:43 +02:00
3 changed files with 16 additions and 8 deletions
+12 -1
View File
@@ -23,6 +23,17 @@ curl -fsSL https://git.ccc-rheintal.ch/spacefreak/pbc/raw/branch/master/install.
This installs the newest tagged version to `/usr/local/bin/pbc`, installs the
dependencies, and puts an example config at `/etc/pbc/config.example`.
### Installing a specific version
Set `PBC_GIT_TAG` to install that tag instead of the newest one:
```bash
curl -fsSL https://git.ccc-rheintal.ch/spacefreak/pbc/raw/branch/master/install.sh | sudo PBC_GIT_TAG=v1.0.0 bash
```
`sudo` drops the environment, so set the variable on the `sudo` command itself (or use
`sudo -E`), not before `curl`. Any Git ref works, e.g. a branch name for testing.
### Updating
Run the same command again to update `pbc` itself:
@@ -32,7 +43,7 @@ curl -fsSL https://git.ccc-rheintal.ch/spacefreak/pbc/raw/branch/master/install.
```
It fetches the newest tag and overwrites `/usr/local/bin/pbc`. Your `/etc/pbc/config` is
left untouched.
left untouched. `PBC_GIT_TAG` works here too, to pin or roll back to a given version.
To update only the `proxmox-backup-client` binary:
+4 -4
View File
@@ -13,7 +13,7 @@ function cleanup_work_dir() {
function download_files() {
local path rc
local query_params=''
[ -n "$GIT_TAG" ] && query_params="?ref=$GIT_TAG"
[ -n "$PBC_GIT_TAG" ] && query_params="?ref=$PBC_GIT_TAG"
while (( $# > 0 )); do
path=$1
@@ -26,9 +26,9 @@ function download_files() {
done
}
GIT_TAG=$(curl -fsSL "$API_ENDPOINT/tags" | grep -o '{"name":"[^"]*"' | sed 's/^{"name":"//;s/"$//' | grep -E '^v[0-9]+' | sort --version-sort | tail -n 1)
if [ -n "$GIT_TAG" ]; then
echo "Info: installing pbc version $GIT_TAG"
[ -z "$PBC_GIT_TAG" ] && PBC_GIT_TAG=$(curl -fsSL "$API_ENDPOINT/tags" | grep -o '{"name":"[^"]*"' | sed 's/^{"name":"//;s/"$//' | grep -E '^v[0-9]+' | sort --version-sort | tail -n 1)
if [ -n "$PBC_GIT_TAG" ]; then
echo "Info: installing pbc version $PBC_GIT_TAG"
else
echo "Warning: no Git tag found, installing from repository default branch" >&2
fi
-3
View File
@@ -86,7 +86,6 @@ function apt_get_install() {
return $rc
}
WORK_DIR=''
function cleanup_work_dir() {
[ -n "$WORK_DIR" ] && [ -d "$WORK_DIR" ] && rm -r "$WORK_DIR"
trap - EXIT
@@ -143,7 +142,6 @@ function install_proxmox_backup_client() {
cleanup_work_dir
}
function arr_contains() {
local search=$1
shift
@@ -275,7 +273,6 @@ while (( $# > 0 )); do
fi
done
if [ -f "$cfgfile" ]; then
perms=$(stat -c '%a' "$cfgfile")
(( 8#$perms & 0022 )) && echo "Error: $cfgfile is writable by group or others!" >&2 && exit 202