Commit 5d4b42db authored by Robert Spencer's avatar Robert Spencer

Move ~/.awit-ssh.conf to ~/.config/awit-ssh.conf

And add support for legacy installations
parent 7baab584
......@@ -234,16 +234,30 @@ my ($forwardHost,$forwardPort,$forwardUsername,@forwardPortExtra);
=head1 CONFIG FILE
The following options are read from C<~/.awit-ssh.conf>, each set of options is organized in an inifile [section].
The following options are read from C<~/.config/awit-ssh.conf> (or C<~/.awit-ssh.conf> for legacy installations), each set
of options is organized in an inifile [section].
=cut
my $configFile;
# Legacy configuration file location
if (-f $ENV{"HOME"}.'/.awit-ssh.conf') {
$configFile = $ENV{"HOME"}.'/.awit-ssh.conf';
}
# XDG Base Directory configuration file location
if (-f $ENV{"HOME"}.'/.config/awit-ssh.conf') {
$configFile = $ENV{"HOME"}.'/.config/awit-ssh.conf';
}
my %iniSetup;
# Check for config and read
my $configFile = $ENV{"HOME"}.'/.awit-ssh.conf';
if (! -f $configFile) {
if (!defined($configFile)) {
$configFile = $ENV{"HOME"}.'/.config/awit-ssh.conf';
print STDERR "No configuration file found. Please answer the questions below to generate it.\n\n";
tie %iniSetup, 'Config::IniFiles';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment