package main
import (
	"AD-Control/public"

	"flag"
)


func main(){

	var reportText  = flag.String(public.Msg_Report,"","report to AD")
	var backupText	= flag.String(public.Msg_Backup,"","backup status to AD")
	var execText	= flag.String(public.Msg_Exec,"","exec to LocalDaemon")
	var userText	= flag.String(public.Msg_User,"","who is running me")
	var wolmacText	= flag.String("wolmac","","input mac address for wake pc")
	var woluserText = flag.String("woluser","","input name for walk pc")
	var runningText = flag.Bool("running",false,"runing daemon.exe & users.exe")

	flag.Parse()
	if *runningText 		{flag_running();return}

	if *reportText 	!= "" { flag_report(reportText,userText)}
	if *backupText 	!= "" { flag_bakcup(backupText)}
	if *execText 	!= "" { flag_exec(execText)}
	if *wolmacText	!= "" { flag_wolmac(wolmacText)}
	if *woluserText	!= "" { flag_woluser(woluserText)}

	return 
}
func flag_report(s *string,who * string){
	public.SendServer(public.GJreport(*s,*who))
}
func flag_bakcup(s *string){
	;
}
func flag_exec(s * string){
	;
}
func flag_wolmac(mac * string){
	if err := public.Wol(*mac); err != nil{
		public.PrintLog(err)
	} else {
		public.PrintLog(*mac)
	}
}
func flag_woluser(user * string){
	public.PrintLog("暂未开发")
}
func flag_running(){
	
}