help please

:global disabled
:global usrname
/tool user-manager user
:foreach i in=[ /tool user-manager user find customer=brendanM ] do={
:set disabled [get $i disabled]
:if ([$disabled] = true) do={
:set usrname [get $i name]}
/interface pptp-server set user=“pptp-$usrname” disabled=yes
}

cant seem to find the error

There are couple problems. The /interface pptpt-server set… command looks like it needs to be inside the if {} statement, and that same command didn’t have enough information. It needed to know which pptp-server item to choose. The code below finds the pptp-server username that corresponds to the user-manager username, and then it disables it.

:global disabled
:global usrname
/tool user-manager user
:foreach i in=[ /tool user-manager user find customer=brendanM ] do={
	:set disabled [get $i disabled]
	:if ($disabled = true) do={
		:set usrname [get $i name]
		/interface pptp-server set number=[/interface pptp-server find where user="pptp-$usrname"] disabled=yes
	}
}

can anyone please help me finish this script



:global file
/file
:foreach i in=[ /file find where type=.txt ] do={
fetch upload=yes address=192.168.84.26 user=anonymous port=21 src-path=$i dst-path=/data/$i mode=ftp password=“”

i need it to fine all the files then upload

when done uploading delete the file

Do you only want to find .txt files, or all files?

This will find all .txt files and upload them, and then delete them:

:foreach i in=[/file find type~".txt"] do={
	/tool fetch upload=yes address=192.168.84.26 user=anonymous port=21 src-path="$[/file get $i name]" dst-path="/data/$[/file get $i name]" mode=ftp password=""
	/file remove $i
}