Skip to content

Commit 24fb42d

Browse files
authored
Merge pull request #4865 from tesilaaliset/fix/fix_docker
Fixing systemctl problem
2 parents 0944ada + 79282f3 commit 24fb42d

File tree

4 files changed

+47
-32
lines changed

4 files changed

+47
-32
lines changed

common/docker-installer.sh

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ sed -i "s/hiddify-manager:latest/hiddify-manager:$TAG/g" docker-compose.yml
2929
echo "REDIS_PASSWORD=$redispassword"> docker.env
3030
echo "MYSQL_PASSWORD=$mysqlpassword">> docker.env
3131

32+
cp docker.env .env
33+
3234
# Start the containers using Docker Compose
3335
docker compose up -d --pull
3436

common/hiddify_installer.sh

+28-25
Original file line numberDiff line numberDiff line change
@@ -249,31 +249,34 @@ function post_update_tasks() {
249249
echo "---------------------Finished!------------------------"
250250
fi
251251
remove_lock $NAME
252-
if [[ $panel_update == 0 ]]; then
253-
systemctl kill -s SIGTERM hiddify-panel
254-
fi
255-
systemctl start hiddify-panel
256-
257-
258-
cd /opt/hiddify-manager/hiddify-panel
259-
if [ "$CREATE_EASYSETUP_LINK" == "true" ];then
260-
hiddify-panel-cli set-setting --key create_easysetup_link --val True
261-
fi
262-
263-
case "$package_mode" in
264-
release|beta)
265-
hiddify-panel-cli set-setting --key package_mode --val $package_mode
266-
;;
267-
dev|develop)
268-
hiddify-panel-cli set-setting --key package_mode --val develop
269-
;;
270-
*)
271-
hiddify-panel-cli set-setting --key auto_update --val False
272-
;;
273-
esac
274-
275-
if [[ $panel_update == 0 && $config_update != 0 ]]; then
276-
bash /opt/hiddify-manager/apply_configs.sh --no-gui --no-log
252+
253+
if [ "$package_mode" != "docker" ];then
254+
if [[ $panel_update == 0 ]]; then
255+
systemctl kill -s SIGTERM hiddify-panel
256+
fi
257+
258+
systemctl start hiddify-panel
259+
260+
cd /opt/hiddify-manager/hiddify-panel
261+
if [ "$CREATE_EASYSETUP_LINK" == "true" ];then
262+
hiddify-panel-cli set-setting --key create_easysetup_link --val True
263+
fi
264+
265+
case "$package_mode" in
266+
release|beta)
267+
hiddify-panel-cli set-setting --key package_mode --val $package_mode
268+
;;
269+
dev|develop)
270+
hiddify-panel-cli set-setting --key package_mode --val develop
271+
;;
272+
*)
273+
hiddify-panel-cli set-setting --key auto_update --val False
274+
;;
275+
esac
276+
277+
if [[ $panel_update == 0 && $config_update != 0 ]]; then
278+
bash /opt/hiddify-manager/apply_configs.sh --no-gui --no-log
279+
fi
277280
fi
278281
}
279282

docker-init.sh

+8
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ fi
3333

3434
cd $(dirname -- "$0")
3535

36+
# Check systemctl is setup correctly for docker.
37+
systemctl is-active --quiet hiddify-panel
38+
if [ $? -ne 0 ]; then
39+
echo "systemctl returned non-zero exit code. Re install systemctl..."
40+
cp other/docker/* /usr/bin/
41+
systemctl restart hiddify-panel
42+
fi
43+
3644
DO_NOT_INSTALL=true ./install.sh install-docker --no-gui $@
3745
./status.sh --no-gui
3846

install.sh

+9-7
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,14 @@ function main() {
5353
fi
5454

5555
# source common/set_config_from_hpanel.sh
56-
update_progress "HiddifyPanel" "Reading Configs from Panel..." 5
57-
set_config_from_hpanel
58-
59-
update_progress "Applying Configs" "..." 8
60-
61-
bash common/replace_variables.sh
56+
if [ "$DO_NOT_RUN" != "true" ];then
57+
update_progress "HiddifyPanel" "Reading Configs from Panel..." 5
58+
set_config_from_hpanel
59+
60+
update_progress "Applying Configs" "..." 8
61+
62+
bash common/replace_variables.sh
63+
fi
6264

6365
if [ "$MODE" != "apply_users" ]; then
6466
bash ./other/deprecated/remove_deprecated.sh
@@ -103,7 +105,7 @@ function main() {
103105
fi
104106

105107
update_progress "${PROGRESS_ACTION}" "Xray" 75
106-
if [[ $(hconfig "core_type") == "xray" ]];then
108+
if [[ $(hconfig "core_type") == "xray" || "$MODE" == "install-docker" ]];then
107109
install_run xray 1 &
108110
else
109111
install_run xray 0 &

0 commit comments

Comments
 (0)