@pirateship/cli
Advanced tools
@@ -9,4 +9,5 @@ #!/bin/bash | ||
| rm -rf /etc/network/interfaces.d/* | ||
| rm -rf /etc/rpi-wifi-country | ||
| pirateship rename raspberrypi | ||
| systemctl disable hostapd || true | ||
| systemctl disable dnsmasq || true |
@@ -14,1 +14,3 @@ #!/bin/bash | ||
| fi | ||
| echo $COUNTRY > /etc/rpi-wifi-country |
+32
-14
@@ -34,6 +34,6 @@ #!/usr/bin/env node | ||
| var system_wpa_supplicant = '/etc/wpa_supplicant/wpa_supplicant.conf' | ||
| var system_wifi_country = '/etc/rpi-wifi-country' | ||
| if (password === undefined) { | ||
| var network = ` | ||
| network={ | ||
| var network = `network={ | ||
| ssid="` + ESSID + `" | ||
@@ -48,9 +48,18 @@ key_mgmt=NONE | ||
| wpa_supplicant_conf = data + network | ||
| fs.writeFile(system_wpa_supplicant, wpa_supplicant_conf, 'utf8', err => { | ||
| if (err) { | ||
| console.log(err) | ||
| var wifiCountry = "US" | ||
| fs.readFile(system_wifi_country, (err, countryData) => { | ||
| if (countryData) { | ||
| wifiCountry = countryData.toString().trim(); | ||
| } | ||
| ifdownup('open wifi network') | ||
| }); | ||
| data = data.toString().trim() | ||
| wpa_supplicant_conf = data + "\ncountry=" + wifiCountry + "\n" + network | ||
| fs.writeFile(system_wpa_supplicant, wpa_supplicant_conf, 'utf8', err => { | ||
| if (err) { | ||
| console.log(err) | ||
| } | ||
| ifdownup('open wifi network') | ||
| }); | ||
| }) | ||
| }); | ||
@@ -70,9 +79,18 @@ } else { | ||
| wpa_supplicant_conf = data + stdout | ||
| fs.writeFile(system_wpa_supplicant, wpa_supplicant_conf, 'utf8', err => { | ||
| if (err) { | ||
| console.log(err) | ||
| var wifiCountry = "US" | ||
| fs.readFile(system_wifi_country, (err, countryData) => { | ||
| if (countryData) { | ||
| wifiCountry = countryData.toString().trim(); | ||
| } | ||
| ifdownup('password network') | ||
| }) | ||
| data = data.toString().trim() | ||
| wpa_supplicant_conf = data + "\ncountry=" + wifiCountry + "\n" + stdout | ||
| fs.writeFile(system_wpa_supplicant, wpa_supplicant_conf, 'utf8', err => { | ||
| if (err) { | ||
| console.log(err) | ||
| } | ||
| ifdownup('password network') | ||
| }) | ||
| }); | ||
| }); | ||
@@ -79,0 +97,0 @@ }); |
+1
-1
| { | ||
| "name": "@pirateship/cli", | ||
| "version": "0.3.6-wificountry0", | ||
| "version": "0.3.6-wificountry4", | ||
| "description": "Thin command-line interface for Raspberry Pi low level configuration.", | ||
@@ -5,0 +5,0 @@ "main": "cli.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
58973
1.16%529
2.72%52
-1.89%