Skip to content

Commit

Permalink
Added version handler, removed it from daemon itself.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 8, 2017
1 parent 5d7e147 commit 68d6cb5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
27 changes: 10 additions & 17 deletions IcculusGopher_daemon.pl
Expand Up @@ -30,9 +30,6 @@
use IO::Select; # bleh.
use POSIX; # bloop.

# Version of IcculusGopher. Change this if you are forking the code.
my $version = 'v0.0.1';

#-----------------------------------------------------------------------------#
# CONFIGURATION VARIABLES: Change to suit your needs... #
#-----------------------------------------------------------------------------#
Expand Down Expand Up @@ -175,20 +172,16 @@ sub gopher_mainline {
$program = undef if $program eq '~';
$program = 'default' if not defined $program or $program eq '';

if ($program eq 'version') {
send_gopher_menu('i', $version);
} else {
my $exe = "$gopherspace/$program";
if ( -f $exe ) {
$ENV{'GOPHERSPACE'} = $gopherspace;
$ENV{'GOPHERHOST'} = $gopherhost;
$ENV{'GOPHERPORT'} = $gopherport;
{ exec $exe, $args; };
syslog("info", "Failed to execute '$exe': $!");
}
send_gopher_menu('3', $no_report_string);
return 1;
my $exe = "$gopherspace/$program";
if ( -f $exe ) {
$ENV{'GOPHERSPACE'} = $gopherspace;
$ENV{'GOPHERHOST'} = $gopherhost;
$ENV{'GOPHERPORT'} = $gopherport;
{ exec $exe, $args; };
syslog("info", "Failed to execute '$exe': $!");
}
send_gopher_menu('3', $no_report_string);
return 1;
}

return 0;
Expand Down Expand Up @@ -291,7 +284,7 @@ sub daemon_upkeep {
# The daemon.

if ($use_syslog) {
syslog("info", "IcculusGopher daemon $version starting up...");
syslog("info", "IcculusGopher daemon starting up...");
}

go_to_background();
Expand Down
4 changes: 4 additions & 0 deletions gopherspace/version
@@ -0,0 +1,4 @@
#!/bin/sh
# Version of IcculusGopher. Change this if you are forking the code.
VERSION='0.0.1'
echo -n "i$VERSION\t\terror.host\t1\r\n"

0 comments on commit 68d6cb5

Please sign in to comment.