Skip to content

Commit

Permalink
解决升级后配置丢失的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
MemoryShadow committed Aug 23, 2021
1 parent e19e26e commit 0fc4e30
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rpm/SPECS/minecraftctl.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: minecraftctl
Version: 1.0.1
Version: 1.0.2
Release: 1%{?dist}
Summary: Minecraft Server control script

Expand Down Expand Up @@ -27,6 +27,14 @@ cp ~/rpmbuild/bin/* $RPM_BUILD_ROOT/usr/sbin/

exit

%install
#1
# 检查本机是否有配置文件,如果有,就将本机配置文件追加在预备的配置文件末尾来保留配置
if [ -f "%{_sysconfdir}/minecraftctl/config" ]; then
echo \# The following is the old configuration >> $RPM_BUILD_ROOT/etc/minecraftctl/config
cat %{_sysconfdir}/minecraftctl/config >> $RPM_BUILD_ROOT/etc/minecraftctl/config
fi

%files
%attr(0755, root, root) %{_sbindir}/minecraftctl
%attr(0644, root, root) %{_sysconfdir}/minecraftctl/config
Expand Down

0 comments on commit 0fc4e30

Please sign in to comment.