mirror of
https://github.com/AuxXxilium/arc-addons.git
synced 2024-11-23 21:50:52 +07:00
amepatch: rewrite service
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
92fa37759b
commit
688f7a24fd
@ -12,22 +12,23 @@ if [ "${1}" = "late" ]; then
|
||||
cp -vf "${0}" "/tmpRoot/usr/arc/addons/"
|
||||
cp -vf /usr/bin/amepatch.sh /tmpRoot/usr/bin/amepatch.sh
|
||||
|
||||
if [ -f "/usr/bin/codecpatch.sh" ]; then
|
||||
echo -e "AME Patch: Codecpatch found -> skipping"
|
||||
else
|
||||
mkdir -p "/tmpRoot/usr/lib/systemd/system"
|
||||
DEST="/tmpRoot/usr/lib/systemd/system/amepatch.service"
|
||||
echo "[Unit]" >${DEST}
|
||||
echo "Description=addon amepatch" >>${DEST}
|
||||
echo "After=multi-user.target" >>${DEST}
|
||||
echo >>${DEST}
|
||||
echo "[Service]" >>${DEST}
|
||||
echo "Type=oneshot" >>${DEST}
|
||||
echo "RemainAfterExit=yes" >>${DEST}
|
||||
echo "ExecStart=/usr/bin/amepatch.sh" >>${DEST}
|
||||
echo >>${DEST}
|
||||
echo "[Install]" >>${DEST}
|
||||
echo "WantedBy=multi-user.target" >>${DEST}
|
||||
cat > ${DEST} <<'EOF'
|
||||
[Unit]
|
||||
Description=addon amepatch
|
||||
After=multi-user.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
RemainAfterExit=yes
|
||||
ExecStartPre=/usr/bin/amepatch.sh
|
||||
ExecStart=/usr/syno/bin/synopkg restart CodecPack
|
||||
ExecStartPost=/usr/syno/bin/systemctl stop amepatch
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
|
||||
ln -vsf /usr/lib/systemd/system/amepatch.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/amepatch.service
|
||||
|
Loading…
Reference in New Issue
Block a user