fix typo
This commit is contained in:
parent
8a83c61688
commit
0685d2e4c8
@ -2,10 +2,14 @@ export const handler = async (event) => {
|
|||||||
let result = "did not send";
|
let result = "did not send";
|
||||||
if (event.subject == "You have deliveries" || event.subject == "You have a delivery"){
|
if (event.subject == "You have deliveries" || event.subject == "You have a delivery"){
|
||||||
// Trigger home notification
|
// 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}'\""`;
|
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';
|
import { Client } from 'ssh2';
|
||||||
const connection = new Client();
|
const connection = new Client();
|
||||||
|
console.info("Set Conn Info");
|
||||||
connection.on('ready', () => {
|
connection.on('ready', () => {
|
||||||
|
console.info("Connection READY")
|
||||||
connection.exec(command, (error, stream) => {
|
connection.exec(command, (error, stream) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.warn(error);
|
console.warn(error);
|
||||||
|
@ -4,8 +4,9 @@
|
|||||||
"description": "Trigger notif from matching WorkMail email",
|
"description": "Trigger notif from matching WorkMail email",
|
||||||
"main": "index.mjs",
|
"main": "index.mjs",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"deploy": "npm run package && aws lambda update-function-code --function-name Deliveries --region us-west-2 --zip-file fileb://./lambda.zip",
|
"deploy": "npm run lint && npm run package && aws lambda update-function-code --function-name Deliveries --region us-west-2 --zip-file fileb://./lambda.zip",
|
||||||
"package": "zip -r -9 lambda.zip ."
|
"package": "zip -r -9 lambda.zip .",
|
||||||
|
"lint": "npx eslint index.mjs --fix"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
Loading…
Reference in New Issue
Block a user