#!/bin/sh
set -e
set -x
-w
+
if [ "$#" -ne 2 ]; then
echo 'Need domain name and mail.'
false
dump_dir=dump
geheim_dir=geheim
su -lc "mkdir ${dump_dir} ${geheim_dir}"
-su -lc "ln -s ${dump_dir} /var/www-dump/${dump_dir}" plom
-su -lc "ln -s ${geheim_dir} /var/www-dump/${geheim_dir}" plom
+su -lc "ln -s /home/plom/${dump_dir} /var/www-dump/${dump_dir}" plom
+su -lc "ln -s /home/plom/${geheim_dir} /var/www-dump/${geheim_dir}" plom
password_geheim=$(pwgen -1)
-echo "foo:${password_geheim}" > /var/www-dump/password_geheim
+echo "foo:{PLAIN}${password_geheim}" > /var/www-dump/password_geheim
+echo "geheim password is: ${password_geheim}"
# Prepare NGINX.
sed -i "s/REPLACE_fqdn_ECALPER/${domain}/g" /etc/nginx/sites-available/dumpsite.nginx