mirror of
https://github.com/rd235/cado
synced 2025-06-05 21:59:29 +02:00
remove user during uninstallation
This commit is contained in:
@@ -9,16 +9,33 @@ foreach(file ${files})
|
||||
if(EXISTS ${file})
|
||||
message(STATUS "Removing file: '${file}'")
|
||||
|
||||
exec_program(
|
||||
${CMAKE_COMMAND} ARGS "-E remove ${file}"
|
||||
OUTPUT_VARIABLE stdout
|
||||
RETURN_VALUE result
|
||||
execute_process(
|
||||
COMMAND bash "-c" "rm ${file}"
|
||||
OUTPUT_VARIABLE remove_file
|
||||
)
|
||||
|
||||
if(NOT "${result}" STREQUAL 0)
|
||||
if(${remove_file})
|
||||
message(FATAL_ERROR "Failed to remove file: '${file}'.")
|
||||
endif()
|
||||
else()
|
||||
MESSAGE(STATUS "File '${file}' does not exist.")
|
||||
endif()
|
||||
endforeach(file)
|
||||
|
||||
message(STATUS "Removing user: 'cado'")
|
||||
execute_process(
|
||||
COMMAND bash "-c" "userdel cado"
|
||||
OUTPUT_VARIABLE remove_user
|
||||
)
|
||||
if(${remove_user})
|
||||
message(FATAL_ERROR "Failed to remove user: 'cado'.")
|
||||
endif()
|
||||
|
||||
message(STATUS "Removing folder: '/usr/local/var/spool/cado'")
|
||||
execute_process(
|
||||
COMMAND bash "-c" "rm -r /usr/local/var/spool/cado"
|
||||
OUTPUT_VARIABLE remove_spool_folder
|
||||
)
|
||||
if("${remove_spool_folder}")
|
||||
message(FATAL_ERROR "Failed to remove folder: '/usr/local/var/spool/cado'.")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user