View | Details | Raw Unified | Return to bug 13216
Collapse All | Expand All

(-)a/debian/scripts/koha-shell (-5 / +8 lines)
Lines 22-28 Getopt::Long::Configure("bundling"); Link Here
22
22
23
my %opts;
23
my %opts;
24
my $res = GetOptions( \%opts, "command|c=s", "help|h", "login|l", "shell|s=s",
24
my $res = GetOptions( \%opts, "command|c=s", "help|h", "login|l", "shell|s=s",
25
    "preserve-environment|p|m", "verbose|v", "kohadir|d=s" );
25
    "preserve-environment|p|m", "verbose|v", "kohadir|d=s", "gitify|g" );
26
26
27
if ( !$res || $opts{help} ) {
27
if ( !$res || $opts{help} ) {
28
    show_help( !$res );
28
    show_help( !$res );
Lines 46-61 if ( $opts{kohadir} ) { Link Here
46
else {
46
else {
47
    $kohadir = '/usr/share/koha/lib';
47
    $kohadir = '/usr/share/koha/lib';
48
}
48
}
49
49
# Now we're set up, build the 'su' command
50
# Now we're set up, build the 'su' command
50
my @su_args;
51
my @su_args;
51
push @su_args, '/usr/bin/sudo';
52
push @su_args, '/usr/bin/sudo';
52
push @su_args, '--preserve-env' if $opts{'preserve-environment'};
53
push @su_args, '--preserve-env' if $opts{'preserve-environment'};
53
push @su_args, '--login' if $opts{login};
54
push @su_args, '--login' if $opts{login};
54
push @su_args, "-u", "$instance-koha";
55
push @su_args, "-u", "$instance-koha";
56
push @su_args, "env ";
57
push @su_args, "KOHA_BASE_DIR=$opts{kohadir}" if $opts{kohadir};
58
push @su_args, "PATH=$kohadir/debian/scripts".':$PATH KOHA_GITIFY=1 ' if  $opts{gitify};
55
push @su_args,
59
push @su_args,
56
    "env "
60
    "KOHA_CONF=/etc/koha/sites/$instance/koha-conf.xml "
57
  . "KOHA_CONF=/etc/koha/sites/$instance/koha-conf.xml "
61
  . "PERL5LIB=$kohadir $shell "
58
  . "PERL5LIB=$kohadir $shell"
59
  . ( $opts{command} ? " -c '$opts{command}'" : '' );
62
  . ( $opts{command} ? " -c '$opts{command}'" : '' );
60
63
61
print "Command: '".join("' '",@su_args)."'\n" if $opts{verbose};
64
print "Command: '".join("' '",@su_args)."'\n" if $opts{verbose};
Lines 90-95 Options: Link Here
90
    -s, --shell SHELL               use SHELL instead of the one from your environment
93
    -s, --shell SHELL               use SHELL instead of the one from your environment
91
    -v, --verbose                   output the full command that will be executed
94
    -v, --verbose                   output the full command that will be executed
92
    -d, --kohadir /path/to/koha     use a different PERL5LIB directory, for example in a git install.
95
    -d, --kohadir /path/to/koha     use a different PERL5LIB directory, for example in a git install.
96
    -g, --gitify                    use shell for a git type install
93
97
94
The default shell is the one currently in use. Refer to su(1) for more detail
98
The default shell is the one currently in use. Refer to su(1) for more detail
95
on these options.
99
on these options.
96
- 

Return to bug 13216