neb/tools/server-setup.sh

28 lines
462 B
Bash
Raw Normal View History

2023-10-20 00:10:39 +02:00
#!/bin/sh
# setup server
## PREFLIGHT
ORIGIN_PWD="$PWD"
if ! [ "$UID" = "0" ]; then
echo "please perform as root, attempting to escalate privileges..."
exec sudo $(cat /proc/$$/cmdline | sed 's/\x00/ /g')
exit 1
fi
echo "testing git connection..."
if ! ssh -Tq git@git.ixvd.net &> /dev/null; then
echo "can't connect to git, please setup ssh"
exit 1
fi
## MAIN
set -e
for s in tools/setup/*; do
echo "running $s..."
sh $s
done