mirror of
https://github.com/binary-kitchen/doorlockd
synced 2024-12-22 10:24:26 +01:00
Added emergency unlock scripts
This commit is contained in:
parent
7b659a832e
commit
d979310893
@ -51,3 +51,7 @@ install(DIRECTORY scripts/ DESTINATION etc/doorlockd/
|
|||||||
install(DIRECTORY scripts/ DESTINATION etc/doorlockd/
|
install(DIRECTORY scripts/ DESTINATION etc/doorlockd/
|
||||||
FILES_MATCHING PATTERN "scripts/post_*lock"
|
FILES_MATCHING PATTERN "scripts/post_*lock"
|
||||||
PERMISSIONS WORLD_EXECUTE WORLD_READ OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE OWNER_WRITE)
|
PERMISSIONS WORLD_EXECUTE WORLD_READ OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE OWNER_WRITE)
|
||||||
|
|
||||||
|
install(DIRECTORY scripts/ DESTINATION etc/doorlockd/
|
||||||
|
FILES_MATCHING PATTERN "scripts/emergency_unlock"
|
||||||
|
PERMISSIONS WORLD_EXECUTE WORLD_READ OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE OWNER_WRITE)
|
||||||
|
@ -23,5 +23,6 @@
|
|||||||
#define POST_LOCK_SCRIPT "@CMAKE_INSTALL_PREFIX@/etc/doorlockd/post_lock &"
|
#define POST_LOCK_SCRIPT "@CMAKE_INSTALL_PREFIX@/etc/doorlockd/post_lock &"
|
||||||
#define PRE_UNLOCK_SCRIPT "@CMAKE_INSTALL_PREFIX@/etc/doorlockd/pre_unlock &"
|
#define PRE_UNLOCK_SCRIPT "@CMAKE_INSTALL_PREFIX@/etc/doorlockd/pre_unlock &"
|
||||||
#define POST_UNLOCK_SCRIPT "@CMAKE_INSTALL_PREFIX@/etc/doorlockd/post_unlock &"
|
#define POST_UNLOCK_SCRIPT "@CMAKE_INSTALL_PREFIX@/etc/doorlockd/post_unlock &"
|
||||||
|
#define EMERGENCY_UNLOCK_SCRIPT "@CMAKE_INSTALL_PREFIX@/etc/doorlockd/emergency_unlock &"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -82,7 +82,7 @@ void Door::_asyncRead()
|
|||||||
goto out;
|
goto out;
|
||||||
} else if (recvBuf == DOOR_EMERGENCY_UNLOCK) {
|
} else if (recvBuf == DOOR_EMERGENCY_UNLOCK) {
|
||||||
_logger(LogLevel::warning, "Someone did an emergency unlock!");
|
_logger(LogLevel::warning, "Someone did an emergency unlock!");
|
||||||
// TODO: Trigger Emergency unlock script
|
system(EMERGENCY_UNLOCK_SCRIPT);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,4 +184,3 @@ bool Door::writeCMD(char c)
|
|||||||
_logger(LogLevel::error, "Sent Serial command, but got no response!");
|
_logger(LogLevel::error, "Sent Serial command, but got no response!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
doorlockd/scripts/emergency_unlock
Executable file
1
doorlockd/scripts/emergency_unlock
Executable file
@ -0,0 +1 @@
|
|||||||
|
#!/bin/bash
|
Loading…
Reference in New Issue
Block a user