23 lines
No EOL
750 B
Bash
Executable file
23 lines
No EOL
750 B
Bash
Executable file
#!/usr/bin/bash
|
|
|
|
# This is a script for running `install.sh`
|
|
# in a remote server using SSH.
|
|
# Configure SSH_SERVER and PROJECT_ROOT variables
|
|
# for using this script.
|
|
|
|
###### ATTENTION ######
|
|
# The install.sh script has a confirmation prompt
|
|
# because it deletes the content of the PROJECT_ROOT folder,
|
|
# just put "yes | install.sh" to automatically confirm.
|
|
|
|
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
SSH_SERVER="example"
|
|
PROJECT_ROOT=example_directory
|
|
|
|
SSH_REMOTE_DIR="${SSH_SERVER}:${PROJECT_ROOT}"
|
|
|
|
ssh "${SSH_SERVER}" "mkdir -p ${PROJECT_ROOT}"
|
|
rsync "${__dir}/install.sh" "${SSH_SERVER}:${PROJECT_ROOT}/install.sh"
|
|
ssh "${SSH_SERVER}" "${PROJECT_ROOT}/install.sh ${PROJECT_ROOT}"
|
|
ssh "${SSH_SERVER}" "systemctl restart downloader" |