warn if key/cert have not been found

This commit is contained in:
psyc://psyced.org/~lynX 2009-12-18 19:47:59 +01:00
parent eba0982e03
commit e01342241a
2 changed files with 13 additions and 0 deletions

View File

@ -387,14 +387,23 @@ X
my $t = $c{_basic_path_PEM_key}; my $t = $c{_basic_path_PEM_key};
if ($t) { if ($t) {
$t = "$config/$t" unless $t =~ m#^/#; $t = "$config/$t" unless $t =~ m#^/#;
print STDERR <<X unless -r $t;
WARNING: Key file $t does not exist.
X
$psyced .= " --tls-key $t"; $psyced .= " --tls-key $t";
} }
if ($t = $c{_basic_path_PEM_certificate}) { if ($t = $c{_basic_path_PEM_certificate}) {
$t = "$config/$t" unless $t =~ m#^/#; $t = "$config/$t" unless $t =~ m#^/#;
print STDERR <<X unless -r $t;
WARNING: Certificate file $t does not exist.
X
$psyced .= " --tls-cert $t"; $psyced .= " --tls-cert $t";
} }
if ($t = $c{_basic_path_trust}) { if ($t = $c{_basic_path_trust}) {
$t = "$config/$t" unless $t =~ m#^/#; $t = "$config/$t" unless $t =~ m#^/#;
print STDERR <<X unless -r $t;
WARNING: Trust directory $t does not exist.
X
$psyced .= " --tls-trustdirectory $t"; $psyced .= " --tls-trustdirectory $t";
} }
# ldmud doesn't support this yet # ldmud doesn't support this yet

View File

@ -319,6 +319,9 @@ get USER "psyc"
if test "x$USER" = "xroot"; then if test "x$USER" = "xroot"; then
echo "" echo ""
echo "You shouldn't run psyced as root, so what about a 'psyc' user?" echo "You shouldn't run psyced as root, so what about a 'psyc' user?"
# indigo6 thinks we should run useradd here, even if some unices
# do not provide that command. we can >/dev/null the error though...
echo "If the user doesn't exist yet, please make one."
fi fi
#while true #while true
#do #do
@ -335,6 +338,7 @@ fi
get GROUP "psyc" get GROUP "psyc"
#while true #while true
#do #do
echo "If such a group doesn't exist yet, please create it now."
ask "Which group do you want to run psyced as" GROUP ask "Which group do you want to run psyced as" GROUP
# if `id -Gn $USER | grep $GROUP > /dev/null` # if `id -Gn $USER | grep $GROUP > /dev/null`
# then # then