2024-08-24 19:43:05 +07:00
|
|
|
#!/usr/bin/env ash
|
2024-08-25 02:16:55 +07:00
|
|
|
#
|
|
|
|
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium>
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the MIT License.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2024-08-24 19:43:05 +07:00
|
|
|
|
|
|
|
if [ "${1}" = "late" ]; then
|
|
|
|
echo "Installing addon arcdns - ${1}"
|
|
|
|
mkdir -p "/tmpRoot/usr/arc/addons/"
|
2024-11-09 01:34:54 +07:00
|
|
|
cp -pf "${0}" "/tmpRoot/usr/arc/addons/"
|
2024-08-24 19:43:05 +07:00
|
|
|
|
2024-11-09 01:34:54 +07:00
|
|
|
cp -pf /usr/bin/arcdns.php /tmpRoot/usr/bin/arcdns.php
|
|
|
|
cp -pf /usr/bin/arcdns.sh /tmpRoot/usr/bin/arcdns.sh
|
2024-11-20 16:51:12 +07:00
|
|
|
|
2024-09-07 18:51:41 +07:00
|
|
|
mkdir -p "/tmpRoot/usr/lib/systemd/system"
|
|
|
|
DEST="/tmpRoot/usr/lib/systemd/system/arcdns.service"
|
2024-11-20 16:51:12 +07:00
|
|
|
{
|
|
|
|
echo "[Unit]"
|
|
|
|
echo "Description=addon arcdns"
|
|
|
|
echo "After=multi-user.target"
|
|
|
|
echo
|
|
|
|
echo "[Service]"
|
|
|
|
echo "Type=oneshot"
|
|
|
|
echo "RemainAfterExit=yes"
|
|
|
|
echo "ExecStart=/usr/bin/arcdns.sh"
|
|
|
|
echo
|
|
|
|
echo "[Install]"
|
|
|
|
echo "WantedBy=multi-user.target"
|
|
|
|
} >"${DEST}"
|
2024-11-09 01:34:54 +07:00
|
|
|
mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
|
2024-09-07 18:51:41 +07:00
|
|
|
ln -vsf /usr/lib/systemd/system/arcdns.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/arcdns.service
|
2024-08-24 19:43:05 +07:00
|
|
|
elif [ "${1}" = "uninstall" ]; then
|
|
|
|
echo "Installing addon arcdns - ${1}"
|
|
|
|
# To-Do
|
|
|
|
fi
|