@@ -758,22 +758,6 @@ function str_starts_with($haystack, $needle) {
758
758
return $ args ;
759
759
});
760
760
761
- // Throw hcpp_rebooted when the system has been started
762
- $ hcpp ->add_action ( 'priv_update_sys_queue ' , function ( $ args ) {
763
-
764
- // Check last reboot time
765
- if ( ! isset ( $ args [0 ] ) ) return $ args ;
766
- if ( $ args [0 ] != 'restart ' ) return $ args ;
767
- $ file = '/usr/local/hestia/data/hcpp/last_reboot.txt ' ;
768
- $ last = shell_exec ("who -b " );
769
- if ( !file_exists ( $ file ) || file_get_contents ( $ file ) !== $ last ) {
770
- file_put_contents ( $ file , $ last );
771
- global $ hcpp ;
772
- $ hcpp ->do_action ( 'hcpp_rebooted ' );
773
- }
774
- return $ args ;
775
- });
776
-
777
761
// Delete the ports file when the domain is deleted
778
762
$ hcpp ->add_action ( 'pre_delete_web_domain_backend ' , function ( $ args ) {
779
763
global $ hcpp ;
@@ -795,10 +779,19 @@ function str_starts_with($haystack, $needle) {
795
779
return $ args ;
796
780
});
797
781
782
+ // Throw hcpp_rebooted when the system has been started
783
+ $ hcpp ->add_action ( 'hcpp_invoke_plugin ' , function ( $ args ) {
784
+ if ( $ args [0 ] == 'hcpp_rebooted ' ) {
785
+ global $ hcpp ;
786
+ $ hcpp ->do_action ( 'hcpp_rebooted ' );
787
+ }
788
+ return $ args ;
789
+ });
790
+
798
791
// Throw hcpp_new_domain_ready via v-invoke-plugin hook
799
792
$ hcpp ->add_action ( 'hcpp_invoke_plugin ' , function ( $ args ) {
800
- global $ hcpp ;
801
793
if ( $ args [0 ] == 'hcpp_new_domain_ready ' ) {
794
+ global $ hcpp ;
802
795
array_shift ( $ args );
803
796
$ hcpp ->do_action ( 'hcpp_new_domain_ready ' , $ args );
804
797
}
0 commit comments