diff --git a/node_modules/.bin/extract-zip b/node_modules/.bin/extract-zip deleted file mode 120000 index af9b561..0000000 --- a/node_modules/.bin/extract-zip +++ /dev/null @@ -1 +0,0 @@ -../extract-zip/cli.js \ No newline at end of file diff --git a/node_modules/.bin/extract-zip b/node_modules/.bin/extract-zip new file mode 100755 index 0000000..b594016 --- /dev/null +++ b/node_modules/.bin/extract-zip @@ -0,0 +1,19 @@ +#!/usr/bin/env node + +/* eslint-disable no-process-exit */ + +var extract = require('./') + +var args = process.argv.slice(2) +var source = args[0] +var dest = args[1] || process.cwd() +if (!source) { + console.error('Usage: extract-zip foo.zip ') + process.exit(1) +} + +extract(source, { dir: dest }) + .catch(function (err) { + console.error('error!', err) + process.exit(1) + }) diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf deleted file mode 120000 index 4cd49a4..0000000 --- a/node_modules/.bin/rimraf +++ /dev/null @@ -1 +0,0 @@ -../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf new file mode 100755 index 0000000..023814c --- /dev/null +++ b/node_modules/.bin/rimraf @@ -0,0 +1,68 @@ +#!/usr/bin/env node + +const rimraf = require('./') + +const path = require('path') + +const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg)) +const filterOutRoot = arg => { + const ok = preserveRoot === false || !isRoot(arg) + if (!ok) { + console.error(`refusing to remove ${arg}`) + console.error('Set --no-preserve-root to allow this') + } + return ok +} + +let help = false +let dashdash = false +let noglob = false +let preserveRoot = true +const args = process.argv.slice(2).filter(arg => { + if (dashdash) + return !!arg + else if (arg === '--') + dashdash = true + else if (arg === '--no-glob' || arg === '-G') + noglob = true + else if (arg === '--glob' || arg === '-g') + noglob = false + else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) + help = true + else if (arg === '--preserve-root') + preserveRoot = true + else if (arg === '--no-preserve-root') + preserveRoot = false + else + return !!arg +}).filter(arg => !preserveRoot || filterOutRoot(arg)) + +const go = n => { + if (n >= args.length) + return + const options = noglob ? { glob: false } : {} + rimraf(args[n], options, er => { + if (er) + throw er + go(n+1) + }) +} + +if (help || args.length === 0) { + // If they didn't ask for help, then this is not a "success" + const log = help ? console.log : console.error + log('Usage: rimraf [ ...]') + log('') + log(' Deletes all files and folders at "path" recursively.') + log('') + log('Options:') + log('') + log(' -h, --help Display this usage info') + log(' -G, --no-glob Do not expand glob patterns in arguments') + log(' -g, --glob Expand glob patterns in arguments (default)') + log(' --preserve-root Do not remove \'/\' (default)') + log(' --no-preserve-root Do not treat \'/\' specially') + log(' -- Stop parsing flags') + process.exit(help ? 0 : 1) +} else + go(0) diff --git a/satpredictionbot.js b/satpredictionbot.js index 606701c..c99dbcd 100644 --- a/satpredictionbot.js +++ b/satpredictionbot.js @@ -94,9 +94,11 @@ async function savetoPDF() { bottom: "46", left: "10" } - const browser = await puppeteer.launch(); + const browser = await puppeteer.launch({ + headless: true, + args: ['--no-sandbox']}); const page = await browser.newPage(); - await page.goto('https://server1.nicholaspease.com/reports/satellitepasspredictions.html'); + await page.goto('http://192.168.0.201/reports/satellitepasspredictions.html'); await page.pdf({ path: '/var/www/html/reports/satellitepasspredictions.pdf', printBackground: true, diff --git a/satpredictionbot.sh b/satpredictionbot.sh old mode 100644 new mode 100755 index e151f16..1cb34f7 --- a/satpredictionbot.sh +++ b/satpredictionbot.sh @@ -1,2 +1,2 @@ -cd /home/npease/scripts/SatellitePredictionGenerator -/usr/local/bin/node /home/npease/scripts/SatellitePredictionGenerator/satpredictionbot.js \ No newline at end of file +cd /root/scripts/SatellitePredictionGenerator +/root/.nvm/versions/node/v19.3.0/bin/node /root/scripts/SatellitePredictionGenerator/satpredictionbot.js