22 Aug 14, 11:05PM
So all three of these work:
However, when I try to piece it together:
It only works for sucmd 0. Any idea what's wrong with it?
[SELECT ALL] Code:
suKWclaim = [loop i $suKWCnt [ if (strstr (curserver 6) (at $suKW $i)) [setadmin 1 (at $supw (at $suKWAssoc $i)); suSuccess = 1;break ] ] ]
suipclaim = [loop i $suipCnt [ if (strstr (curserver 1) (at $suip $i)) [setadmin 1 (at $supw (at $suipAssoc $i)); suSuccess = 1; break ] ] ]
suipptclaim = [loop i $suipptCnt [ if (strstr (curserver 1) (concat (at $suippt_ip $i) (at $suippt_pt ))) [setadmin 1 (at $supw (at $suipptAssoc $i)); suSuccess = 1; break ] ] ]
However, when I try to piece it together:
[SELECT ALL] Code:
suSuccess = 0
.....code goes here....
sudrop = [setadmin 0]
sucmd = [sudoiter = $arg1; if ( = sudoiter 0) [suKWclaim] [if ( = sudoiter 1) [suipclaim] [ if (= sudoiter 2) [suipptclaim]]]]sudo = [if (currole) [sudrop] [ loop j 3 [echo $j; (sucmd $j); if (suSuccess) [break] ]];suSuccess = 0;]