mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 09:49:28 +08:00
[Fix] OpenWrt agent install script (#1005)
* Update install-agent.sh * Update install-agent.sh * Update install-agent.sh
This commit is contained in:
@@ -227,8 +227,8 @@ if [ "$UNINSTALL" = true ]; then
|
|||||||
rm -f /var/log/beszel-agent.log /var/log/beszel-agent.err
|
rm -f /var/log/beszel-agent.log /var/log/beszel-agent.err
|
||||||
elif is_openwrt; then
|
elif is_openwrt; then
|
||||||
echo "Stopping and disabling the agent service..."
|
echo "Stopping and disabling the agent service..."
|
||||||
service beszel-agent stop
|
/etc/init.d/beszel-agent stop
|
||||||
service beszel-agent disable
|
/etc/init.d/beszel-agent disable
|
||||||
|
|
||||||
echo "Removing the OpenWRT service files..."
|
echo "Removing the OpenWRT service files..."
|
||||||
rm -f /etc/init.d/beszel-agent
|
rm -f /etc/init.d/beszel-agent
|
||||||
@@ -288,13 +288,13 @@ package_installed() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Check for package manager and install necessary packages if not installed
|
# Check for package manager and install necessary packages if not installed
|
||||||
if is_alpine; then
|
if package_installed apk; then
|
||||||
if ! package_installed tar || ! package_installed curl || ! package_installed coreutils; then
|
if ! package_installed tar || ! package_installed curl || ! package_installed sha256sum; then
|
||||||
apk update
|
apk update
|
||||||
apk add tar curl coreutils shadow
|
apk add tar curl coreutils shadow
|
||||||
fi
|
fi
|
||||||
elif is_openwrt; then
|
elif package_installed opkg; then
|
||||||
if ! package_installed tar || ! package_installed curl || ! package_installed coreutils; then
|
if ! package_installed tar || ! package_installed curl || ! package_installed sha256sum; then
|
||||||
opkg update
|
opkg update
|
||||||
opkg install tar curl coreutils
|
opkg install tar curl coreutils
|
||||||
fi
|
fi
|
||||||
@@ -596,10 +596,10 @@ EOF
|
|||||||
|
|
||||||
# Enable the service
|
# Enable the service
|
||||||
chmod +x /etc/init.d/beszel-agent
|
chmod +x /etc/init.d/beszel-agent
|
||||||
service beszel-agent enable
|
/etc/init.d/beszel-agent enable
|
||||||
|
|
||||||
# Start the service
|
# Start the service
|
||||||
service beszel-agent restart
|
/etc/init.d/beszel-agent restart
|
||||||
|
|
||||||
# Auto-update service for OpenWRT using a crontab job
|
# Auto-update service for OpenWRT using a crontab job
|
||||||
if [ "$AUTO_UPDATE_FLAG" = "true" ]; then
|
if [ "$AUTO_UPDATE_FLAG" = "true" ]; then
|
||||||
@@ -627,9 +627,9 @@ EOF
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
# Check service status
|
# Check service status
|
||||||
if ! service beszel-agent running >/dev/null 2>&1; then
|
if ! /etc/init.d/beszel-agent running >/dev/null 2>&1; then
|
||||||
echo "Error: The Beszel Agent service is not running."
|
echo "Error: The Beszel Agent service is not running."
|
||||||
service beszel-agent status
|
/etc/init.d/beszel-agent status
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user