mirror of
https://github.com/sky22333/hubproxy.git
synced 2026-08-05 03:24:57 +08:00
优化构建和打包
This commit is contained in:
27
packaging/postinstall.sh
Normal file
27
packaging/postinstall.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
warn() {
|
||||
echo "hubproxy: $1"
|
||||
}
|
||||
|
||||
if command -v systemctl >/dev/null 2>&1; then
|
||||
systemctl daemon-reload || warn "systemd reload failed"
|
||||
systemctl enable hubproxy >/dev/null 2>&1 || warn "systemd enable failed"
|
||||
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl restart hubproxy || systemctl start hubproxy || {
|
||||
warn "service start failed, check: journalctl -u hubproxy"
|
||||
}
|
||||
fi
|
||||
fi
|
||||
|
||||
if command -v rc-update >/dev/null 2>&1; then
|
||||
rc-update add hubproxy default >/dev/null 2>&1 || warn "OpenRC enable failed"
|
||||
fi
|
||||
|
||||
if command -v rc-service >/dev/null 2>&1; then
|
||||
rc-service hubproxy restart || rc-service hubproxy start || {
|
||||
warn "service start failed, check: rc-service hubproxy status"
|
||||
}
|
||||
fi
|
||||
Reference in New Issue
Block a user