From cd242ce7161a99ad2e24e84353de308cd404601d Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 30 Jan 2021 21:16:46 +0100 Subject: removed everything --- configure-gpio.service | 25 ---------------- httpdocs/index.php | 78 -------------------------------------------------- 2 files changed, 103 deletions(-) delete mode 100644 configure-gpio.service delete mode 100644 httpdocs/index.php diff --git a/configure-gpio.service b/configure-gpio.service deleted file mode 100644 index e638274..0000000 --- a/configure-gpio.service +++ /dev/null @@ -1,25 +0,0 @@ -[Unit] -Description=configure the GPIO pins - -[Service] -Type=oneshot -RemainAfterExit=yes - -# power led -ExecStart=/usr/bin/gpio mode 4 in -ExecStart=/usr/bin/gpio mode 4 up - -# hdd led -ExecStart=/usr/bin/gpio mode 5 in -ExecStart=/usr/bin/gpio mode 5 up - -# power switch -ExecStart=/usr/bin/gpio mode 3 out -ExecStart=/usr/bin/gpio write 3 0 - -# reset switch -ExecStart=/usr/bin/gpio mode 2 out -ExecStart=/usr/bin/gpio write 2 0 - -[Install] -WantedBy=multi-user.target diff --git a/httpdocs/index.php b/httpdocs/index.php deleted file mode 100644 index b2b9bda..0000000 --- a/httpdocs/index.php +++ /dev/null @@ -1,78 +0,0 @@ -&1', 'r'); -if ($f === false) { - print 'Cannot access gpio' . "\n"; - die(); -} -$l = trim(fgets($f)); -pclose($f); - -if ($l == '') { - print 'Cannot read gpio - is it installed?' . "\n"; - die(); -} - -if (array_key_exists('HTTPS', $_SERVER) -&& ($_SERVER['HTTPS'] == 'on')) - $https = true; -else - $https = false; - -function push_it() { - if (!array_key_exists('password', $_POST)) - return; - $f = fopen('../password', 'r'); - if ($f === false) { - print 'Cannot read password file
' . "\n"; - return; - } - $saved_hash = trim(fgets($f)); - fclose($f); - $entered_hash = $_POST['password']; - for ($i=0; $i<1000; $i++) - $entered_hash = hash('sha512', $entered_hash . $i . $_POST['password']); - if ($saved_hash != $entered_hash) { - print 'Wrong password: ' . $entered_hash . '
' . "\n"; - return; - } - foreach ($_POST as $key => $dummy) - if (preg_match('/^push_([0-9]+)$/', $key, $duration)) - break; - if (count($duration) != 2) - return; - $duration = $duration[1]; - if (($duration > 0) - && ($duration < 300)) { - print 'pushing for ' . ($duration * 0.1) . ' seconds ...
' . "\n"; - shell_exec('/usr/bin/gpio write 3 1'); - flush(); - usleep(100000 * $duration); - shell_exec('/usr/bin/gpio write 3 0'); - print '... done
' . "\n"; - } -} - -print '' . "\n"; -print '' . "\n"; -print 'fenster lights-out' . "\n"; -if (array_key_exists('password', $_POST)) - print '' . "\n"; -print '' . "\n"; -print '' . "\n"; -print 'Fenster is currently '; -if ($l == '1') - print 'off'; -else - print 'on'; -print '
' . "\n"; -if ($https) { - push_it(); - print '
' . "\n"; - print 'Passwort:
' . "\n"; - print '
' . "\n"; - print '
' . "\n"; - print '
' . "\n"; -} -print '' . "\n"; -print '' . "\n"; -- cgit v1.2.3-54-g00ecf