aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ii/templates/ii_wrapper.pl
diff options
context:
space:
mode:
Diffstat (limited to 'modules/ii/templates/ii_wrapper.pl')
-rw-r--r--modules/ii/templates/ii_wrapper.pl15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/ii/templates/ii_wrapper.pl b/modules/ii/templates/ii_wrapper.pl
new file mode 100644
index 00000000..68128314
--- /dev/null
+++ b/modules/ii/templates/ii_wrapper.pl
@@ -0,0 +1,15 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use POSIX;
+use Proc::Daemon;
+my $nick = "<%= @nick %>";
+my $server = "<%= @server %>";
+
+
+Proc::Daemon::Init();
+my (undef, undef, $uid) = getpwnam("nobody");
+POSIX::setuid($uid);
+
+fork() || exec "ii -n $nick -i /var/lib/ii/$nick -s $server";
+wait();