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