29 lines
512 B
Bash
29 lines
512 B
Bash
|
#!/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
|
||
|
echo "setting up
|