Cette révision appartient à :
@@ -0,0 +1,27 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Create archive
|
||||||
|
run: |
|
||||||
|
mkdir dist
|
||||||
|
cp -r src/* dist/
|
||||||
|
tar -czf usb-control.tar.gz -C dist .
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
files: usb-control.tar.gz
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
+16
-12
@@ -1,17 +1,21 @@
|
|||||||
/var/www/usb-toggle.php
|
# USB Control Plugin for moOde
|
||||||
/usr/local/bin/usb-bind-wrapper
|
|
||||||
|
|
||||||
dans header
|
Adds a USB power control entry in the moOde UI.
|
||||||
|
|
||||||
add-header.php
|
## ✨ Features
|
||||||
|
|
||||||
Juste avant <li id="bluetooth-hide"><a href="blu-config.php"><i class="fa-light fa-brands fa-bluetooth sx"></i>Bluetooth</a></li>
|
- Toggle USB power from the web interface
|
||||||
-----------
|
- Visual status indicator
|
||||||
Dans les script
|
|
||||||
<script src="/js/usb-toggle.js"></script>
|
|
||||||
-----------
|
|
||||||
js/usb-toogle.js
|
|
||||||
|
|
||||||
cat /etc/sudoers.d/010_www-data-nopasswd
|
---
|
||||||
www-data ALL=(ALL) NOPASSWD: ALL
|
|
||||||
|
|
||||||
|
## 🚀 Quick Install (one command)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -L https://git.celjim.fr/jimmyGALLAND/moodeaudio-usb-control/releases/latest/download/moodeaudio-usb-control.tar.gz \
|
||||||
|
| tar xz && cd moodeaudio-usb-control && sudo ./install.sh
|
||||||
|
|
||||||
|
## 🧼 Uninstall
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo ./uninstall.sh
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "== USB Control plugin uninstall =="
|
||||||
|
|
||||||
|
WEB_DIR="/var/www"
|
||||||
|
HEADER_FILE="$WEB_DIR/header.php"
|
||||||
|
BIN_TARGET="/usr/local/bin/usb-bind-wrapper.sh"
|
||||||
|
|
||||||
|
# 1. Supprimer fichiers web
|
||||||
|
echo "-- Remove web files"
|
||||||
|
|
||||||
|
rm -f "$WEB_DIR/usb-toogle.php"
|
||||||
|
rm -rf "$WEB_DIR/js/usb-toggle.js"
|
||||||
|
|
||||||
|
sudo rm -f "$BIN_TARGET"
|
||||||
|
|
||||||
|
echo "-- Cleaning header.php"
|
||||||
|
|
||||||
|
if grep -q 'usb-toggle.js' "$HEADER_FILE"; then
|
||||||
|
TMP=$(mktemp)
|
||||||
|
|
||||||
|
grep -v 'usb-toggle.js' "$HEADER_FILE" > "$TMP"
|
||||||
|
|
||||||
|
sudo mv "$TMP" "$HEADER_FILE"
|
||||||
|
echo "JS reference removed"
|
||||||
|
else
|
||||||
|
echo "No JS reference found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "== Uninstall complete =="
|
||||||
Référencer dans un nouveau ticket
Bloquer un utilisateur