File tree Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Define the path to the target script
4
+ target_script=" /usr/local/bin/hcpp_rebooted.sh"
5
+
6
+ # Check if the target script already exists
7
+ if [ ! -f " $target_script " ]; then
8
+ cat << EOT >> "$target_script "
9
+ #!/bin/bash
10
+
11
+ # Wait for the mount point to be available
12
+ while [ ! -d "/media/appFolder" ]; do
13
+ sleep 1
14
+ done
15
+
16
+ # Throw a reboot event to trigger the HCPP rebooted hook
17
+ /usr/local/hestia/bin/v-invoke-plugin hcpp_rebooted
18
+
19
+ EOT
20
+ chmod +x " $target_script "
21
+ echo " Installed hcpp_rebooted.sh"
22
+ else
23
+ echo " hcpp_rebooted.sh already exists. Skipping installation."
24
+ fi
25
+
26
+ # Check if the service file already exists
27
+ service_file=" /etc/systemd/system/hcpp_rebooted.service"
28
+ if [ ! -f " $service_file " ]; then
29
+ cat << EOT >> "$service_file "
30
+ [Unit]
31
+ Description=Trigger hcpp_rebooted hook
32
+ After=network.target
33
+
34
+ [Service]
35
+ Type=oneshot
36
+ ExecStartPre=/bin/sleep 10
37
+ ExecStart=$target_script
38
+
39
+ [Install]
40
+ WantedBy=multi-user.target
41
+
42
+ EOT
43
+ systemctl enable hcpp_rebooted.service
44
+ echo " Installed hcpp_rebooted.service"
45
+ else
46
+ echo " hcpp_rebooted.service already exists. Skipping installation."
47
+ fi
Original file line number Diff line number Diff line change 12
12
13
13
// Copy pluginable.php to /usr/local/hestia/web/pluginable.php
14
14
copy ( '/etc/hestiacp/hooks/pluginable.php ' , '/usr/local/hestia/web/pluginable.php ' );
15
- shell_exec (' cd /usr/local/hestia/web/js/dist && wget https://code.jquery.com/jquery-3.7.0.min.js ' );
15
+ shell_exec ( __DIR__ . ' /install_hcpp_reboot.sh ' && cd /usr/local/hestia/web/js/dist && wget https://code.jquery.com/jquery-3.7.0.min.js' );
16
16
17
17
// Ensure log is present and writable when needed
18
18
if ( ! file_exists ( '/tmp/hcpp.log ' ) ) {
You can’t perform that action at this time.
0 commit comments