This commit is contained in:
2024-10-04 19:04:08 -04:00
parent 8a83c61688
commit 0685d2e4c8
2 changed files with 7 additions and 2 deletions

View File

@@ -2,10 +2,14 @@ export const handler = async (event) => {
let result = "did not send";
if (event.subject == "You have deliveries" || event.subject == "You have a delivery"){
// Trigger home notification
console.info("Matched Subject");
const command = `ssh ${process.env.INTERNAL_HOST} "/usr/bin/tmux neww -d \"/usr/bin/mplayer '${process.env.INTERNAL_FILE}'\""`;
console.info("Import ssh2");
import { Client } from 'ssh2';
const connection = new Client();
console.info("Set Conn Info");
connection.on('ready', () => {
console.info("Connection READY")
connection.exec(command, (error, stream) => {
if (error) {
console.warn(error);