2023-08-15 18:01:53 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
if [[ "$(realpath "$(dirname "$(realpath -s "$0")")/../../../")" == "/" ]]; then
|
|
|
|
. /usr/local/libexec/zio/helpers/bash.sh
|
|
|
|
else
|
|
|
|
. "$(dirname "$(realpath -s "$0")")/../libexec/zio/helpers/bash.sh"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# TODO: Check if we're actually using the rootfs git
|
|
|
|
|
|
|
|
test_root
|
2023-08-15 18:03:03 +02:00
|
|
|
test_prog "git"
|
2023-08-15 18:01:53 +02:00
|
|
|
|
2023-08-22 23:26:21 +02:00
|
|
|
say info "Fetching latest..."
|
|
|
|
|
2023-08-15 18:01:53 +02:00
|
|
|
orig_dir="$(pwd)"
|
|
|
|
cd /
|
|
|
|
|
2023-08-15 18:03:03 +02:00
|
|
|
git fetch --all
|
2023-08-15 18:04:10 +02:00
|
|
|
git reset --hard origin/main
|
2023-08-15 18:01:53 +02:00
|
|
|
|
2023-12-03 03:36:56 +01:00
|
|
|
say info "Update submodules..."
|
|
|
|
|
|
|
|
git submodule update --init --recursive .
|
|
|
|
|
2023-08-15 18:01:53 +02:00
|
|
|
cd $orig_dir
|
2023-08-22 23:26:21 +02:00
|
|
|
|
|
|
|
say info "Reloading daemons..."
|
|
|
|
|
|
|
|
systemctl daemon-reload
|