execute command remote server from local shell script code example
Example: Running a local script on a remote machine (or remote on local)
ssh [email protected] 'bash -s' < scriptfile.sh
ssh [email protected] 'bash -s' < scriptfile.sh