#!/usr/bin/perl $| = 1; open(STDERR, ">&STDOUT"); use warnings; use CGI; use IPC::Open2; $q = CGI->new; print( "Content-type: text/plain\n\n"); if( $q->param('r') && $q->param('n') && $q->param('v') ) { unless( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'pinyconfig', $q->param('r'), $q->param('n'), $q->param('v') ) == 0 ) { die( 'pinyconfig was unsuccessful.' ); }; } elsif( $q->param('r') ) { unless( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'pinyconfig', $q->param('r') ) == 0 ) { die( 'pinyconfig was unsuccessful.' ); }; } else { print 'Missing parameters.'; };