diff options
-rwxr-xr-x | videoadd.pl | 7 | ||||
-rwxr-xr-x | videodb-check.pl | 7 | ||||
-rw-r--r-- | videodb.rc | 3 | ||||
-rwxr-xr-x | videomv.pl | 7 | ||||
-rwxr-xr-x | videorm.pl | 7 |
5 files changed, 17 insertions, 14 deletions
diff --git a/videoadd.pl b/videoadd.pl index 27d40b5..9e7788b 100755 --- a/videoadd.pl +++ b/videoadd.pl @@ -35,7 +35,7 @@ my %config = do $confile; die "Error in `" .$confile. "'.\n" if $@ || not %config; map { exists $config{$_} || die "Error: Missing `${_}'.\n" } - qw /videodir driver database hostname user port password userid imdb url/; + qw /videodir driver database hostname user password userid imdb url/; $config{prefix} = "" unless exists $config{prefix}; my $symlinks = catdir($config{videodir},'MOVIES'); # Symlinks folder @@ -180,7 +180,7 @@ e.g., videodir => catdir($HOME,'video'), driver => 'mysql', database => 'videodb', - hostname => '127.0.0.1', + hostname => 'example.org', user => 'username', port => 3306, password => '******', @@ -232,7 +232,8 @@ pod2usage(2) if $#ARGV != 0; my $dbh; unless ( defined $ignoredb_flag ) { # Connect to database - my $dsn = "DBI:$config{driver}:database=$config{database};host=$config{hostname};port=$config{port}"; + my $dsn = "DBI:$config{driver}:database=$config{database};host=$config{hostname}"; + $dsn .= ";port=$config{port}" if defined $config{port}; if (defined $config{dbi_misc}) { while (my ($k,$v) = each %{$config{dbi_misc}}) { $dsn .= ";$k=$v"; diff --git a/videodb-check.pl b/videodb-check.pl index 1e5691b..bf45d6b 100755 --- a/videodb-check.pl +++ b/videodb-check.pl @@ -24,7 +24,7 @@ my %config = do $confile; die "Error in `" .$confile. "'\n" if $@ || not %config; map { exists $config{$_} || die "Error: Missing `${_}'.\n" } - qw /videodir driver database hostname user port password/; + qw /videodir driver database hostname user password/; $config{prefix} = "" unless exists $config{prefix}; my $symlinks = catdir($config{videodir},'MOVIES'); # Symlinks folder @@ -102,7 +102,7 @@ e.g., videodir => catdir($HOME,'video'), driver => 'mysql', database => 'videodb', - hostname => '127.0.0.1', + hostname => 'example.org', user => 'username', port => 3306, password => '******', @@ -134,7 +134,8 @@ if (@ARGV) { ################################################################################ # Connect to database -my $dsn = "DBI:$config{driver}:database=$config{database};host=$config{hostname};port=$config{port}"; +my $dsn = "DBI:$config{driver}:database=$config{database};host=$config{hostname}"; +$dsn .= ";port=$config{port}" if defined $config{port}; if (defined $config{dbi_misc}) { while (my ($k,$v) = each %{$config{dbi_misc}}) { $dsn .= ";$k=$v"; @@ -6,9 +6,8 @@ videodir => catdir($HOME,'video'), driver => 'mysql', database => 'videodb', -hostname => '127.0.0.1', +hostname => 'localhost', user => 'username', -port => 3306, # Optional extra connection options dbi_misc => { mysql_ssl => 1 , mysql_ssl_ca_file => "/etc/ssl/certs/cacert.org.pem" @@ -29,7 +29,7 @@ my %config = do $confile; die "Error in `" .$confile. "'\n" if $@ || not %config; map { exists $config{$_} || die "Error: Missing `${_}'.\n" } - qw /videodir driver database hostname user port password/; + qw /videodir driver database hostname user password/; $config{prefix} = "" unless exists $config{prefix}; my $symlinks = catdir($config{videodir},'MOVIES'); # Symlinks folder @@ -307,7 +307,7 @@ e.g., videodir => catdir($HOME,'video'), driver => 'mysql', database => 'videodb', - hostname => '127.0.0.1', + hostname => 'example.org', user => 'username', port => 3306, password => '******', @@ -379,7 +379,8 @@ my @real_directors = splitdir($real_directors); # Connect to database my ($dsn, $dbh, $RES, $nRES, $id); unless (defined $ignoredb_flag) { - $dsn = "DBI:$config{driver}:database=$config{database};host=$config{hostname};port=$config{port}"; + $dsn = "DBI:$config{driver}:database=$config{database};host=$config{hostname}"; + $dsn .= ";port=$config{port}" if defined $config{port}; if (defined $config{dbi_misc}) { while (my ($k,$v) = each %{$config{dbi_misc}}) { $dsn .= ";$k=$v"; @@ -29,7 +29,7 @@ my %config = do $confile; die "Error in `" .$confile. "'\n" if $@ || not %config; map { exists $config{$_} || die "Error: Missing `${_}'.\n" } - qw /videodir driver database hostname user port password/; + qw /videodir driver database hostname user password/; $config{prefix} = "" unless exists $config{prefix}; my $symlinks = catdir($config{videodir},'MOVIES'); # Symlinks folder @@ -109,7 +109,7 @@ e.g., videodir => catdir($HOME,'video'), driver => 'mysql', database => 'videodb', - hostname => '127.0.0.1', + hostname => 'example.org', user => 'username', port => 3306, password => '******', @@ -161,7 +161,8 @@ if (-l $file_s) { # Connect to database -my $dsn = "DBI:$config{driver}:database=$config{database};host=$config{hostname};port=$config{port}"; +my $dsn = "DBI:$config{driver}:database=$config{database};host=$config{hostname}"; +$dsn .= ";port=$config{port}" if defined $config{port}; if (defined $config{dbi_misc}) { while (my ($k,$v) = each %{$config{dbi_misc}}) { $dsn .= ";$k=$v"; |