2024-08-18 02:13:35 +07:00
|
|
|
#!/usr/bin/env ash
|
|
|
|
|
|
|
|
if [ "${1}" = "late" ]; then
|
2024-08-19 05:03:13 +07:00
|
|
|
echo "Installing addon sspatch - ${1}"
|
|
|
|
mkdir -p "/tmpRoot/usr/arc/addons/"
|
|
|
|
cp -vf "${0}" "/tmpRoot/usr/arc/addons/"
|
|
|
|
|
|
|
|
cp -vf /usr/bin/sspatch.sh /tmpRoot/usr/bin/sspatch.sh
|
|
|
|
cp -vf /usr/bin/license.sh /tmpRoot/usr/bin/license.sh
|
|
|
|
cp -vf /usr/bin/S82surveillance.sh /tmpRoot/usr/bin/S82surveillance.sh
|
|
|
|
|
|
|
|
mkdir -p "/tmpRoot/usr/lib/systemd/system"
|
|
|
|
DEST="/tmpRoot/usr/lib/systemd/system/sspatch.service"
|
|
|
|
cat << EOF > ${DEST}
|
|
|
|
[Unit]
|
|
|
|
Description=addon amepatch
|
|
|
|
After=multi-user.target
|
2024-08-18 02:13:35 +07:00
|
|
|
|
2024-08-19 05:03:13 +07:00
|
|
|
[Service]
|
|
|
|
Type=simple
|
|
|
|
Restart=on-failure
|
|
|
|
RestartSec=5s
|
|
|
|
ExecStart=/usr/bin/sspatch.sh
|
2024-08-18 02:13:35 +07:00
|
|
|
|
2024-08-19 05:03:13 +07:00
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
2024-08-19 04:19:18 +07:00
|
|
|
|
2024-08-19 05:03:13 +07:00
|
|
|
[X-Synology]
|
|
|
|
Author=Virtualization Team
|
|
|
|
EOF
|
2024-08-19 04:19:18 +07:00
|
|
|
|
2024-08-19 05:03:13 +07:00
|
|
|
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
|
|
|
|
ln -vsf /usr/lib/systemd/system/sspatch.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/sspatch.service
|
|
|
|
fi
|
2024-08-18 02:13:35 +07:00
|
|
|
elif [ "${1}" = "uninstall" ]; then
|
|
|
|
echo "Installing addon sspatch - ${1}"
|
|
|
|
# To-Do
|
|
|
|
fi
|