Commit 15df1afe authored by Leigh B Stoller's avatar Leigh B Stoller

More tweaks for shellinabox console support.

parent 7c7db3fc
......@@ -196,6 +196,7 @@ $OPSVM_ENABLE = @OPSVM_ENABLE@;
# mrouted no longer needed; replaced by IGMP querier in mfrisbeed
$NEEDMROUTED = 0;
$ARCHSUPPORT = @ARCHIVESUPPORT@;
$BROWSER_CONSOLE_ENABLE = @BROWSER_CONSOLE_ENABLE@;
#
# Some programs we use
......
......@@ -15,7 +15,6 @@ use libinstall;
use installvars;
my $SHAREDKEY = "$PREFIX/etc/sshauth.key";
my $LOGFILE = "$PREFIX/log/shellinabox.log";
sub Install($$$)
{
......@@ -26,18 +25,9 @@ sub Install($$$)
if ($isupdate);
Phase "shellinabox", "Adding ShellInABox Support", sub {
Phase "syslog", "Setting up syslog on ops", sub {
if (ExecQuiet("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" grep -q -s shellinabox $SYSLOG_CONF")) {
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" 'echo \"\\\!shellinabox\" >> $SYSLOG_CONF'");
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" 'echo \"*.*\t\t $LOGFILE\" >> $SYSLOG_CONF'");
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" 'echo \"$LOGFILE\t\t640 7 1000 * Z\" ".
" >> $NEWSYSLOG_CONF'");
}
};
PhaseSkip("shellinabox not enabled")
if (!$BROWSER_CONSOLE_ENABLE);
#
# Need a secret shared key for signing.
#
......@@ -61,22 +51,6 @@ sub Install($$$)
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" $APACHE_START_COMMAND restart");
};
Phase "logfile", "Creating logfile on ops", sub {
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" 'touch $LOGFILE; chmod 640 $LOGFILE'");
};
Phase "json", "Installing json port on ops", sub {
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" 'cd /usr/ports/converters/p5-JSON; make install'");
};
Phase "hmac", "Installing hmac digest port on ops", sub {
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" 'cd /usr/ports/secret/p5-Digest-HMAC; make install'");
};
Phase "sha1", "Installing sha1 digest port on ops", sub {
ExecQuietFatal("$SSH -o 'BatchMode=yes' root\@${USERNODE} ".
" 'cd /usr/ports/secret/p5-digest-SHA1; make install'");
};
};
return 0;
}
......
#
# Install shellinabox using source code from Utah.
#
use strict;
use libinstall;
use installvars;
sub Install($$$)
{
my ($server, $isupdate, $impotent) = @_;
# Replace if this script does an update for ip/domain.
return 0
if ($isupdate);
my $SOURCEURL = "http://$OUTER_BOSS/downloads/shellinabox.tar.Z";
my $SOURCEDIR = "$PREFIX/src/shellinabox";
my $BUILDDIR = "$PREFIX/obj/shellinabox";
my $localtarfile = "/tmp/shellinabox.tar.gz";
my $LOGFILE = "$PREFIX/log/shellinabox.log";
Phase "shellinabox", "Installing shellinabox", sub {
PhaseSkip("shellinabox not enabled")
if (!$BROWSER_CONSOLE_ENABLE);
Phase "fetching", "Fetching shellinabox distribution", sub {
DoneIfExists($localtarfile);
FetchFileFatal($SOURCEURL, $localtarfile);
};
Phase "unpacking", "Unpacking shellinabox distribution", sub {
if (! -e "$SOURCEDIR") {
mkdir("$SOURCEDIR", 0770) or
PhaseFail("Unable to make $SOURCEDIR : $!");
}
ExecQuietFatal("$CHOWN elabman $SOURCEDIR");
PhaseSkip("shellinabox already unpacked")
if (-e "$SOURCEDIR/shellinabox");
ExecQuietFatal("$TAR zxf $localtarfile -C $SOURCEDIR");
};
Phase "config", "Configuring shellinabox", sub {
if (! -e "$BUILDDIR") {
mkdir("$BUILDDIR", 0770) or
PhaseFail("Unable to make $BUILDDIR : $!");
}
ExecQuietFatal("$CHOWN elabman $BUILDDIR");
ExecQuietFatal("cd $BUILDDIR ; $SOURCEDIR/shell*/configure ");
};
Phase "building", "Building shellinabox", sub {
ExecQuietFatal("cd $BUILDDIR; make");
};
Phase "installing", "Installing", sub {
ExecQuietFatal("cd $BUILDDIR; make install");
};
Phase "json", "Installing json port", sub {
ExecQuietFatal("cd /usr/ports/converters/p5-JSON; make install");
};
Phase "hmac", "Installing hmac digest port", sub {
ExecQuietFatal("cd /usr/ports/security/p5-Digest-HMAC; make install");
};
Phase "sha1", "Installing sha1 digest port", sub {
ExecQuietFatal("cd /usr/ports/security/p5-Digest-SHA1; make install");
};
Phase "logfile", "Creating $LOGFILE", sub {
ExecQuietFatal("touch $LOGFILE; chmod 640 $LOGFILE");
};
Phase "syslog", "Setting up syslog", sub {
if (ExecQuiet("grep -q -s shellinabox $SYSLOG_CONF")) {
ExecQuietFatal("echo '!shellinabox' >> $SYSLOG_CONF");
ExecQuietFatal("echo '*.*\t\t $LOGFILE' >> $SYSLOG_CONF");
ExecQuietFatal("echo '$LOGFILE\t\t640 7 1000 * Z' ".
" >> $NEWSYSLOG_CONF");
}
};
};
return 0;
}
# Local Variables:
# mode:perl
# End:
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