#!/usr/bin/ruby # # This script part of n4d4d suite # # Copyright : Angel Berlanas Vicente # This script is licensed under GPL v3 or higher # def get_ppds # Variable directori_of_ppds = "/etc/cups/ppd/*.ppd" files = Dir.glob(directori_of_ppds) dict_to_print = "" files.each do |ppd| dict_to_print = dict_to_print +"\""+ ppd.to_s + "\"," end puts "[True, {'list_files':[" + dict_to_print + "]}]" end def info # Show the info to the user puts "USAGE" puts "* list_files : Show the ppds installed at the machine" puts "* info : Show this info" end # # Main program # ARGV.each do |arg| if arg == "list_files" get_ppds() end if arg == "info" info() end end