2023-12-03 06:50:43 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
scriptPath="$(dirname "$(readlink -f "$0")")"
|
|
|
|
|
2023-12-03 12:31:01 -05:00
|
|
|
if [[ ! -f "${scriptPath}/profiles.toml" ]]; then
|
|
|
|
cp "${scriptPath}/templates/profiles.toml" "${scriptPath}/profiles.toml"
|
|
|
|
fi
|
|
|
|
if [[ ! -f "${scriptPath}/excludes" ]]; then
|
|
|
|
cp "${scriptPath}/templates/excludes" "${scriptPath}/excludes"
|
|
|
|
fi
|
|
|
|
if [[ ! -f "${scriptPath}/key" ]]; then
|
|
|
|
resticprofile generate --random-key > "${scriptPath}/key"
|
|
|
|
fi
|
|
|
|
chmod go-rwx "${scriptPath}/key "${scriptPath}/profiles.toml" "${scriptPath}/excludes"
|