#!/usr/bin/php5 -q
setEncryptionKey("secret-gosa-password");
if($sock->connected()){
/* Prepare a hunge bunch of data to be send */
# jobdb add
#$data = " gosa_network_completition GOSAGOSAws-muc-2";
#$data = " 10.89.1.155:2008300:01:6c:9d:b9:fa00:1B:77:04:8A:6C 20130102133908 ";
#$data = " GOSA 00:01:6c:9d:b9:fa 00:01:6c:9d:b9:fa19700101000000 ";
# jobdb delete
#$data = " GOSA GOSA 1";
# smbhash
#$data = " GOSAGOSAtester";
# Reload ldap config
#$data = " gosa_trigger_reload_ldap_config GOSA00:01:6c:9d:b9:fa";
# jobdb update
#$data = " gosa_update_status_jobdb_entry GOSA GOSA 1 19700101000000";
#$data = " gosa_update_status_jobdb_entry GOSAGOSA 00:01:6c:9d:b9:fa processing update";
# jobdb query
#$data = "GOSA GOSAandgt0le5";
#$data = "GOSA GOSA like %0102% ";
#$data= "GOSA GOSAping03";
#$data= "GOSA GOSAtrigger_action_reinstall025timestamp DESC";
#$data= "GOSA GOSA";
#$data= "GOSA GOSA";
#$data= "GOSA GOSA";
#$data= "GOSA GOSA";
# jobdb count
#$data = " GOSA GOSA";
#$data = " GOSA GOSA";
#$data = " GOSA GOSA";
# jobdb clear
#$data = " GOSA GOSA";
# set gosa-si-client to 'activated'
#$data = " job_set_activated_for_installation 10.89.1.31:20083 GOSA 00:01:6c:9d:b9:fa22220101000000";
# trigger jobs at client
#$data = " 10.89.1.31:20083 10.89.1.31:20081 ";
#$data = " 00:01:6c:9d:b9:fa 10.89.1.31:20081 ";
#$data = " 00:01:6c:9d:b9:fa GOSA 19700101000000";
#$data = " gosa_trigger_action_faireboot 00:01:6c:9d:b9:fa GOSA ";
#$data = " gosa_trigger_action_reboot 00:01:6c:9d:b9:fa GOSA ";
#$data = " job_trigger_action_reinstall GOSA 00:01:6c:9d:b9:fa 00:01:6c:9d:b9:fa 19700101000000 ";
#$data = " job_trigger_action_instant_update 00:01:6c:9d:b9:fa GOSA 19700101000000 ";
#$data = " 00:01:6c:9d:b9:fa GOSA ";
# get_login_usr_for_client
#$data = " gosa_get_login_usr_for_client GOSA GOSA 00:01:6c:9d:b9:fa";
# get_client_for_login_usr
#$data = " gosa_get_client_for_login_usr GOSA GOSA harald";
##################
# recreate fai dbs
#$data = " gosa_recreate_fai_server_db GOSA GOSA";
$data = " gosa_recreate_fai_release_db GOSA GOSA";
#$data = " gosa_recreate_packages_list_db GOSA GOSA";
###########
# messaging
#$data = " GOSA GOSA eine wichtige nachricht admin rettenbe 20130101235959 kaffeepause ";
################
# logHandling.pm
# all date and mac parameter accept regular expression as input unless other instructions are given
# show_log_by_mac, show_log_by_date, show_log_by_date_and_mac, show_log_files_by_date_and_mac,
# get_log_file_by_date_and_mac, delete_log_by_date_and_mac, get_recent_log_by_mac
#$data = " GOSA GOSA 00:01:6C:9D:B9:FA 00:01:6c:9d:b9:fb ";
#$data = " GOSA GOSA 20080313 20080323 ";
#$data = " gosa_show_log_by_date_and_mac GOSA GOSA 200803 00:01:6c:9d:b9:FA ";
#$data = " gosa_delete_log_by_date_and_mac GOSA GOSA 00:01:6c:9d:b9:fa";
#$data = " gosa_get_recent_log_by_mac GOSA GOSA 00:01:6c:9d:b9:fa";
# exact date and mac are required as input
#$data = " gosa_show_log_files_by_date_and_mac GOSA GOSA install_20080311_090900 00:01:6c:9d:b9:fa ";
#$data = " gosa_get_log_file_by_date_and_mac GOSA GOSA install_20080311_090900 00:01:6c:9d:b9:fa boot.log";
#########
# testing
#$data = " GOSA GOSA";
$sock->write($data);
$answer = "nothing";
$answer = $sock->read();
echo "$count: $answer\n";
$sock->close();
}else{
echo "... FAILED!\n";
}
}
?>