Tuesday, July 13, 2010

ACNG Client side perl script part two

Please refer to these previous articles : Setting up ACNG ACNG client side perl script for set up and scripting Apt-Cacher-NG.


I have made some modifications to the perl script to allow for simple gui integration.
Props to @gpled for showing me zenity a couple of months ago.

Change this:
#!usr/bin/perl -w
#script by @robots_unix

{
print "Are you at CCC?";
$name = ;
chomp ($name);
if ($name eq "yes"){

To this:

#!usr/bin/perl -w
#script by @robots_unix
system('zenity --title "Apt-Cacher-NG" --text "Are you at CCC?" --list --radiolist --column "ACNG" --column "Toggle" False no True yes> aptyesno');

{
open(APT, "Location of aptyesno");
$name = ;
if ($name eq "yes\n"){


Then right-click on gnome-panel, click add to panel, click create custom application launcher, then for the command type: sudo perl location of your perl script.

Now you can change the hosts file by just clicking an icon on your gnome-panel.

Have fun.

No comments: