Files
bearnet/image/overlay/daemon/update-keys.sh
2026-06-16 16:42:28 +08:00

15 lines
341 B
Bash
Executable File

#!/bin/sh
# VARIABLES: _REVISION_ _REPO_
set -euo pipefail
mkdir -p /users && chown keeper /users && chmod 644 /users
init_repo(){
su - keeper 'git clone -b _REVISION_ _REPO_ /users'
}
if [[ ! -d /users/.git ]]; then
init_repo
elif [[ -d /users && cd /users && ! su - keeper 'git pull origin _REVISION_' ]]; then
init_repo
fi