···11+#!/bin/bash
22+33+# Variables
44+BINARY_NAME="appview"
55+BINARY_PATH=".bin/app"
66+SERVER="95.111.206.63"
77+USER="appview"
88+99+# SCP the binary to root's home directory
1010+scp "$BINARY_PATH" root@$SERVER:/root/"$BINARY_NAME"
1111+1212+# SSH into the server and perform the necessary operations
1313+ssh root@$SERVER <<EOF
1414+ set -e # Exit on error
1515+1616+ # Move binary to /usr/local/bin and set executable permissions
1717+ mv /root/$BINARY_NAME /usr/local/bin/$BINARY_NAME
1818+ chmod +x /usr/local/bin/$BINARY_NAME
1919+2020+ su appview
2121+ cd ~
2222+ ./reset.sh
2323+EOF
2424+2525+echo "Deployment complete."
2626+