Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonbrazell/sunrise-sunset
Scripts that schedule a boot or an OS (Windows) shutdown at sunrise and sunset.
https://github.com/simonbrazell/sunrise-sunset
boot openwrt powershell shell-script shutdown sunrise sunset
Last synced: 12 days ago
JSON representation
Scripts that schedule a boot or an OS (Windows) shutdown at sunrise and sunset.
- Host: GitHub
- URL: https://github.com/simonbrazell/sunrise-sunset
- Owner: SimonBrazell
- License: mit
- Created: 2021-05-08T02:06:06.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-06-03T12:29:37.000Z (over 3 years ago)
- Last Synced: 2024-11-27T11:37:32.370Z (2 months ago)
- Topics: boot, openwrt, powershell, shell-script, shutdown, sunrise, sunset
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sunrise Startup / Sunset Shutdown
Scripts that schedule a startup (WoL) or an OS (Windows) shutdown at sunrise and sunset.
## Use Case
I made these to help limit the power consumption of my PC (mining rig), by restricting it's operation to between the hours of sunrise and sunset. This is when solar panels installed at it's location are generating an output and thus offsetting / providing green energy for the device.
## Sunrise Startup
### Prequisites:
- Network device running OpenWrt
- `date` (GNU coreutils 8.32)
- `curl`
- `jq`
- `wakeonlan`
- Enable Wake on LAN on the target device.### Start / Stop:
1. Open the `sunrise-startup.sh` file, and populate it with your details as follows:
```
LATITUDE="YOUR_LATITUDE"
LONGITUDE="YOUR_LONGITUDE"
MAC_ADDRESS="YOUR_MAC_ADDRESS"
BROADCAST_ADDRESS="YOUR_BROADCAST_ADDRESS"
```2. `mv sunrise-startup.sh /usr/local/bin/sunrise-startup` on the OpenWrt device.
3. Make the script executable `chmod +x /usr/local/bin/sunrise-startup`
4. Run `/usr/local/bin/sunrise-startup`
5. Run `crontab -l` to see the scheduled task.
6. To stop, remove the task.## Sunset Shutdown
### Prequisites:
- Windows PowerShell
### Start / Stop:
1. Open the `sunset-shutdown.ps1` file, and populate it with your latitude and longitude as follows:
```
$latitude="YOUR_LATITUDE"
$longitude="YOUR_LONGITUDE"
```2. To start run `sunset-shutdown.ps1` with Powershell.
3. To stop open `Task Scheduler` and delete `\SunsetShutdown\ShutdownTask`.