From ab13e25fa67565703b9d9325967560042da0579b Mon Sep 17 00:00:00 2001 From: Michael Heise Date: Sat, 6 Jul 2024 15:03:21 +0200 Subject: [PATCH] v1.0.4: remove restart script, add reconfigure script edit and update README.rst update copyright years --- README.rst | 16 ++++++++++------ raspi-gpio3-shutdown.py | 6 +++--- raspi-gpio3-shutdown.service | 2 +- script/reconfigure | 2 +- script/restart | 7 ------- 5 files changed, 15 insertions(+), 18 deletions(-) delete mode 100644 script/restart diff --git a/README.rst b/README.rst index d93fc53..2c669b3 100644 --- a/README.rst +++ b/README.rst @@ -16,20 +16,24 @@ Required packages Installation / Maintenance -------------------------- -After download, configure the serive by editing the file ``raspi-gpio3-shutdown.conf`` (see Configuration_). +Download raspi-gpio3-shutdown via **Code** button or from `Releases `_ page (you most likely did already). +Unzip the received file: + + ``unzip raspi-gpio3-shutdown-main.zip -d ~/raspi-gpio-shutdown`` + +Configure the service by editing the file ``raspi-gpio3-shutdown.conf`` (see Configuration_). Then simply run the script ``install`` in the **script** sub-folder. It will download and install the required packages, copy the files to their destinations, will register the service, and finally start it. For uninstall, use the second provided script ``uninstall``. -If you like to change the configuration while your system is running, you might use the script ``restart``. -This will copy the changed configuration file to **/etc** folder (overwrites previous version!), and then restart the service. +If you need to change the configuration after installation, you might use the script ``reconfigure`` after editing the source configuration file. +This will stop the service, copy the changed configuration file to **/etc** folder (overwrites previous version!), and then start the service again. Configuration ------------- - -The configuration is defined in the file ``raspi-gpio3-shutdown.conf``. Before installation, you will find it in the -folder where you unzipped the package files. After installation, the active version is in **/etc** folder. +The configuration is defined in the file ``raspi-gpio3-shutdown.conf``. Before installation, you will find the source file in the folder where you unzipped the package files. +After installation, the active version is in **/etc** folder. The configuration file requires a section ``[GPIO]`` with one mandatory key ``Button``. The ``Button`` key must be created based on this pattern:: diff --git a/raspi-gpio3-shutdown.py b/raspi-gpio3-shutdown.py index b7294dc..44f8d8e 100644 --- a/raspi-gpio3-shutdown.py +++ b/raspi-gpio3-shutdown.py @@ -7,10 +7,10 @@ __author__ = "Michael Heise" __copyright__ = "Copyright (C) 2021 by Michael Heise" __license__ = "Apache License Version 2.0" -__version__ = "1.0.3" -__date__ = "11/06/2021" +__version__ = "1.0.4" +__date__ = "07/06/2024" -# Copyright 2021 Michael Heise (mikiair) +# Copyright 2021-2024 Michael Heise (mikiair) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/raspi-gpio3-shutdown.service b/raspi-gpio3-shutdown.service index f55a4fc..287df6e 100644 --- a/raspi-gpio3-shutdown.service +++ b/raspi-gpio3-shutdown.service @@ -1,4 +1,4 @@ -# Copyright 2021 Michael Heise (mikiair) +# Copyright 2021-2024 Michael Heise (mikiair) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/script/reconfigure b/script/reconfigure index ca33d39..16ec6db 100644 --- a/script/reconfigure +++ b/script/reconfigure @@ -7,7 +7,7 @@ set -e cd "$(dirname "$0")/.." sudo systemctl stop raspi-gpio3-shutdown -sudo cp raspi-gpio3-shutdown.conf /etc +sudo cp -u raspi-gpio3-shutdown.conf /etc sudo systemctl start raspi-gpio3-shutdown systemctl status raspi-gpio3-shutdown diff --git a/script/restart b/script/restart deleted file mode 100644 index 32115c3..0000000 --- a/script/restart +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -echo "Restarting raspi-gpio3-shutdown service..." -sudo systemctl restart raspi-gpio3-shutdown -systemctl status raspi-gpio3-shutdown -echo "Done." -