#!/bin/bash

# 复制二进制文件到/usr/local/bin/
cp log-cleaner /usr/local/bin/
chmod +x /usr/local/bin/log-cleaner

# 复制服务文件到/etc/systemd/system/
cp log-cleaner.service /etc/systemd/system/

# 重新加载systemd并启用服务
systemctl daemon-reload
systemctl enable log-cleaner.service
systemctl start log-cleaner.service

echo "安装完成，服务已启动"