Introduce ZM_PATH_SHUTDOWN to cmake config
This commit is contained in:
parent
ac8197f2e5
commit
c4d76f03c9
|
@ -166,6 +166,8 @@ set(ZM_DIR_SOUNDS "sounds" CACHE PATH
|
|||
"Location to look for optional sound files, default: sounds")
|
||||
set(ZM_PATH_ZMS "/cgi-bin/nph-zms" CACHE PATH
|
||||
"Web url to zms streaming server, default: /cgi-bin/nph-zms")
|
||||
set(ZM_PATH_SHUTDOWN "/sbin/shutdown" CACHE PATH
|
||||
"Path to shutdown binary, default: /sbin/shutdown")
|
||||
|
||||
# Advanced
|
||||
set(ZM_PATH_MAP "/dev/shm" CACHE PATH
|
||||
|
|
|
@ -24,6 +24,7 @@ override_dh_auto_configure:
|
|||
-DZM_CONFIG_SUBDIR="/etc/zm/conf.d" \
|
||||
-DZM_CONFIG_DIR="/etc/zm" \
|
||||
-DZM_DIR_EVENTS="/var/cache/zoneminder/events" \
|
||||
-DZM_PATH_SHUTDOWN="/sbin/shutdown" \
|
||||
-DZM_PATH_ZMS="/zm/cgi-bin/nph-zms"
|
||||
|
||||
override_dh_auto_install:
|
||||
|
|
|
@ -27,6 +27,7 @@ override_dh_auto_configure:
|
|||
-DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \
|
||||
-DZM_CACHEDIR="/var/cache/zoneminder/cache" \
|
||||
-DZM_DIR_EVENTS="/var/cache/zoneminder/events" \
|
||||
-DZM_PATH_SHUTDOWN="/sbin/shutdown" \
|
||||
-DZM_PATH_ZMS="/zm/cgi-bin/nph-zms"
|
||||
|
||||
override_dh_clean:
|
||||
|
|
|
@ -27,6 +27,7 @@ override_dh_auto_configure:
|
|||
-DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \
|
||||
-DZM_CACHEDIR="/var/cache/zoneminder/cache" \
|
||||
-DZM_DIR_EVENTS="/var/cache/zoneminder/events" \
|
||||
-DZM_PATH_SHUTDOWN="/sbin/shutdown" \
|
||||
-DZM_PATH_ZMS="/zm/cgi-bin/nph-zms"
|
||||
|
||||
override_dh_clean:
|
||||
|
|
|
@ -10,6 +10,7 @@ configure_file(com.zoneminder.systemctl.rules.in "${CMAKE_CURRENT_BINARY_DIR}/co
|
|||
configure_file(zoneminder.service.in "${CMAKE_CURRENT_BINARY_DIR}/zoneminder.service" @ONLY)
|
||||
configure_file(zoneminder-tmpfiles.conf.in "${CMAKE_CURRENT_BINARY_DIR}/zoneminder-tmpfiles.conf" @ONLY)
|
||||
configure_file(zoneminder.desktop.in "${CMAKE_CURRENT_BINARY_DIR}/zoneminder.desktop" @ONLY)
|
||||
configure_file(zm-sudo.in "${CMAKE_CURRENT_BINARY_DIR}/zm-sudo" @ONLY)
|
||||
|
||||
# Do not install the misc files by default
|
||||
#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/apache.conf" "${CMAKE_CURRENT_BINARY_DIR}/logrotate.conf" "${CMAKE_CURRENT_BINARY_DIR}/syslog.conf" DESTINATION "${CMAKE_INSTALL_DATADIR}/zoneminder/misc")
|
||||
|
|
|
@ -27,18 +27,18 @@ if ( $action ) {
|
|||
if ( $action == 'shutdown' ) {
|
||||
$output = array();
|
||||
$rc = 0;
|
||||
exec("sudo -n /sbin/shutdown -P $when 2>&1", $output, $rc);
|
||||
exec('sudo -n '.ZM_PATH_SHUTDOWN." -P $when 2>&1", $output, $rc);
|
||||
#exec('sudo -n /bin/systemctl poweroff -i 2>&1', $output, $rc);
|
||||
ZM\Logger::Debug("Shutdown output $rc " . implode("\n",$output));
|
||||
#ZM\Logger::Debug("Shutdown output " . shell_exec('/bin/systemctl poweroff -i 2>&1'));
|
||||
} else if ( $action == 'restart' ) {
|
||||
$output = array();
|
||||
exec("sudo -n /sbin/shutdown -r $when 2>&1", $output);
|
||||
exec('sudo -n '.ZM_PATH_SHUTDOWN." -r $when 2>&1", $output);
|
||||
#exec('sudo -n /bin/systemctl reboot -i 2>&1', $output);
|
||||
ZM\Logger::Debug("Shutdown output " . implode("\n",$output));
|
||||
} else if ( $action == 'cancel' ) {
|
||||
$output = array();
|
||||
exec('sudo /sbin/shutdown -c 2>&1', $output);
|
||||
exec('sudo '.ZM_PATH_SHUTDOWN.' -c 2>&1', $output);
|
||||
}
|
||||
} # end if action
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue