Created
December 6, 2016 20:53
-
-
Save niraj-shah/a0b70682678defe416fb1c375af3603d to your computer and use it in GitHub Desktop.
Laravel SSH Commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// see if file exists on remote | |
SSH::into($env)->exists( 'path/on/remote/filename.extension' ); | |
// upload file to remote | |
SSH::into($env)->put( 'path/to/local/filename', 'path/on/remote/filename' ); | |
// run a command - only works on SSH connections | |
SSH::into($env)->run( 'shasum path/on/remote/filename.extension', function( $line ) { | |
// display output of command, by line | |
echo $line; | |
} ); | |
// download file from remote | |
SSH::into($env)->get( 'path/on/remote/filename', 'path/to/download/filename' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment