UART Rasperry to Arduino

I have connected my arduino mega with my raspberry.
Now I want to create a script that say me what type of arduino is connected and the port. Is it possible?
Example /dev/ttyS3 ArduinoMega........

Now I want to create a script that say me what type of arduino is connected and the port.

On the Arduino? The Arduino already knows what type it is (or, at least what type you compiled the code for, which had to have been correct in order for the upload to succeed). I'm not sure what you mean by "the port". You KNOW which instance of Serial you are using to read from/write to the Pi. It's the one you connected the wires to.

Example /dev/ttyS3 ArduinoMega........

The Mega is NOT using /dev/ttyS3. It knows NOTHING about port names.