2021-08-20 14:17:00 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2021-08-29 13:08:35 -04:00
|
|
|
. .drone/common.sh
|
2021-08-20 14:34:29 -04:00
|
|
|
|
2021-08-20 14:17:00 -04:00
|
|
|
# set FQDN in /etc/hosts
|
2021-08-21 02:27:33 -04:00
|
|
|
add_fqdn_to_hosts $(get_ip_addr $(hostname)) phosphoric-acid
|
|
|
|
add_fqdn_to_hosts $(get_ip_addr auth1) auth1
|
2021-08-29 13:08:35 -04:00
|
|
|
add_fqdn_to_hosts $(get_ip_addr coffee) coffee
|
2021-09-09 20:13:39 -04:00
|
|
|
# mail container doesn't run in CI
|
|
|
|
if [ -z "$CI" ]; then
|
|
|
|
add_fqdn_to_hosts $(get_ip_addr mail) mail
|
|
|
|
fi
|
2021-08-20 14:17:00 -04:00
|
|
|
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
apt update
|
|
|
|
apt install -y netcat-openbsd
|
2021-09-10 18:29:32 -04:00
|
|
|
auth_setup phosphoric-acid
|
2021-08-29 13:08:35 -04:00
|
|
|
|
2021-08-20 14:17:00 -04:00
|
|
|
# initialize the skel directory
|
|
|
|
shopt -s dotglob
|
|
|
|
mkdir -p /users/skel
|
|
|
|
cp /etc/skel/* /users/skel/
|
2021-09-09 20:13:39 -04:00
|
|
|
|
|
|
|
# create directories for users
|
|
|
|
for user in ctdalek regular1 exec1; do
|
|
|
|
mkdir /users/$user
|
|
|
|
chown $user:$user /users/$user
|
|
|
|
done
|
|
|
|
|
2021-09-10 18:29:32 -04:00
|
|
|
sync_with coffee
|
2021-09-09 20:13:39 -04:00
|
|
|
if [ -z "$CI" ]; then
|
2021-09-10 18:29:32 -04:00
|
|
|
sync_with mail
|
2021-09-09 20:13:39 -04:00
|
|
|
sleep infinity
|
|
|
|
fi
|