mirror of
https://github.com/AuxXxilium/arc-addons.git
synced 2024-11-23 21:50:52 +07:00
ledcontrol: temp fix (need more time)
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
75a4e33a2b
commit
6023b700d1
@ -34,84 +34,24 @@ if [ "${1}" = "late" ]; then
|
|||||||
cat > ${DEST} <<'EOF'
|
cat > ${DEST} <<'EOF'
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Ledcontrol for Ugreen
|
Description=Ledcontrol for Ugreen
|
||||||
|
DefaultDependencies=no
|
||||||
|
IgnoreOnIsolate=true
|
||||||
After=multi-user.target
|
After=multi-user.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
User=root
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
ExecStart=/usr/bin/ledcontrol.sh on
|
ExecStart=/usr/bin/ledcontrol.sh on
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
[X-Synology]
|
||||||
|
Author=Virtualization Team
|
||||||
EOF
|
EOF
|
||||||
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
|
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
|
||||||
ln -vsf /usr/lib/systemd/system/ledcontrol_disk.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/ledcontrol_disk.service
|
ln -vsf /usr/lib/systemd/system/ledcontrol.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/ledcontrol.service
|
||||||
|
|
||||||
elif [ "${1}" = "nothing" ]; then
|
|
||||||
mkdir -p "/tmpRoot/usr/lib/systemd/system"
|
|
||||||
# NIC
|
|
||||||
DEST="/tmpRoot/usr/lib/systemd/system/ledcontrol.service"
|
|
||||||
cat > ${DEST} <<'EOF'
|
|
||||||
[Unit]
|
|
||||||
Description=NIC Ledcontrol for Ugreen
|
|
||||||
DefaultDependencies=no
|
|
||||||
IgnoreOnIsolate=true
|
|
||||||
After=multi-user.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
User=root
|
|
||||||
Type=simple
|
|
||||||
Restart=always
|
|
||||||
RestartSec=10s
|
|
||||||
ExecStart=/usr/bin/ledcontrol.sh nic
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
EOF
|
|
||||||
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
|
|
||||||
ln -vsf /usr/lib/systemd/system/ledcontrol_disk.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/ledcontrol_disk.service
|
|
||||||
# Disk
|
|
||||||
DEST="/tmpRoot/usr/lib/systemd/system/ledcontrol_disk.service"
|
|
||||||
cat > ${DEST} <<'EOF'
|
|
||||||
[Unit]
|
|
||||||
Description=Disk Ledcontrol for Ugreen
|
|
||||||
DefaultDependencies=no
|
|
||||||
IgnoreOnIsolate=true
|
|
||||||
After=multi-user.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
User=root
|
|
||||||
Type=simple
|
|
||||||
Restart=always
|
|
||||||
RestartSec=5min
|
|
||||||
ExecStart=/usr/bin/ledcontrol.sh disk
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
EOF
|
|
||||||
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
|
|
||||||
ln -vsf /usr/lib/systemd/system/ledcontrol_disk.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/ledcontrol_disk.service
|
|
||||||
# CPU
|
|
||||||
DEST="/tmpRoot/usr/lib/systemd/system/ledcontrol_cpu.service"
|
|
||||||
cat > ${DEST} <<'EOF'
|
|
||||||
[Unit]
|
|
||||||
Description=CPU Ledcontrol for Ugreen
|
|
||||||
DefaultDependencies=no
|
|
||||||
IgnoreOnIsolate=true
|
|
||||||
After=multi-user.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
User=root
|
|
||||||
Type=simple
|
|
||||||
Restart=always
|
|
||||||
RestartSec=200ms
|
|
||||||
ExecStart=/usr/bin/ledcontrol.sh cpu
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
EOF
|
|
||||||
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
|
|
||||||
ln -vsf /usr/lib/systemd/system/ledcontrol_cpu.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/ledcontrol_cpu.service
|
|
||||||
elif [ "${1}" = "uninstall" ]; then
|
elif [ "${1}" = "uninstall" ]; then
|
||||||
echo "Installing addon ledcontrol - ${1}"
|
echo "Installing addon ledcontrol - ${1}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user