2023-10-18 01:31:05 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# setup new server
|
|
|
|
|
|
|
|
## PREFLIGHT
|
|
|
|
|
|
|
|
if ! [ "$UID" = "0" ]; then
|
|
|
|
echo "please perform as root, attempting to escalate privileges..."
|
|
|
|
exec sudo $0
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! ssh git@git.ixvd.net; then
|
|
|
|
echo "can't connect to git, please setup ssh"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
## MAIN
|
|
|
|
|
|
|
|
if ! [ -d "/neb" ]; then
|
|
|
|
echo "setting up ixvd/neb repo"
|
|
|
|
git clone \
|
|
|
|
--recurse-submodules \
|
|
|
|
git@git.ixvd.net:ixvd/neb \
|
|
|
|
/neb
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! [ -d "/etc/cron.d/restic.crontab" ]; then
|
2023-10-18 01:57:15 +02:00
|
|
|
echo "setting up restic cron"
|
|
|
|
mkdir -p /etc/cron.d/
|
|
|
|
cp /neb/common/restic/restic.crontab /etc/cron.d/restic.crontab
|
|
|
|
fi
|