refactor: setup-server.sh
This commit is contained in:
parent
ac6b592d7f
commit
ab9970715a
8 changed files with 17 additions and 14 deletions
6
tools/server-setup.d/00-apply-skel.sh
Normal file
6
tools/server-setup.d/00-apply-skel.sh
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
if ! [ -f "/etc/ixvd/version" ]; then
|
||||
echo "applying overlay..."
|
||||
cp -r skel/. /
|
||||
fi
|
|
@ -13,7 +13,7 @@ if ! [ "$UID" = "0" ]; then
|
|||
fi
|
||||
|
||||
echo "testing git connection..."
|
||||
if ! ssh -Tq git@git.ixvd.net &> /dev/null; then
|
||||
if ! ssh -Tq git@git.ixvd.net &>/dev/null; then
|
||||
echo "can't connect to git, please setup ssh"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -22,7 +22,15 @@ fi
|
|||
|
||||
set -e
|
||||
|
||||
for s in tools/setup/*; do
|
||||
if [ -d "servers/$HOSTNAME/setup.d" ]; then
|
||||
echo "running server specific setup scripts..."
|
||||
for s in servers/$HOSTNAME/setup.d/*; do
|
||||
echo "running $s..."
|
||||
sh $s
|
||||
done
|
||||
fi
|
||||
|
||||
for s in tools/server-setup.d/*; do
|
||||
echo "running $s..."
|
||||
sh $s
|
||||
done
|
||||
done
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
if ! [ -f "/etc/ixvd/version" ]; then
|
||||
echo "applying overlay..."
|
||||
cp -r skel/. /
|
||||
fi
|
||||
|
||||
if [ -d "servers/$HOSTNAME/skel" ]; then
|
||||
echo "applying server specific skeleton..."
|
||||
cp -r servers/$HOSTNAME/skel/. /
|
||||
fi
|
Loading…
Reference in a new issue