OSDN Git Service

b9643334a395df2f47420f4de33b8d4ccee5a147
[portsreinstall/current.git] / lib / chroot-mount / libtemp.sh
1 #!/bin/sh -e
2 # ==============================================================================
3 # portsreinstall library script
4 # Overlay onto lib/libtemp.sh for portsreinstall-chroot-mount
5 # - Temporary directory and signal trapping -
6 # Copyright (C) 2018 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
7 # This software is distributed under the 2-Clause BSD License.
8 # ==============================================================================
9
10 # ============= Set the termination process =============
11 temp_setup_terminate_process ()
12 {
13         temp_terminate_process ()
14         {
15                 local errno
16                 errno=${1:-0}
17                 [ $opt_batch_mode = yes -o $errno -eq 0 ] && return
18                 message_echo
19                 if [ $errno -eq 130 ]
20                 then
21                         message_echo "INFO: Terminated at `message_timestamp`."
22                         message_echo
23                         message_echo " You can safely rerun to continue."
24                 else
25                         message_echo "INFO: Aborted at `message_timestamp`."
26                         message_echo
27                         message_echo " You may rerun to continue after manually resolving the problem."
28                 fi
29         }
30 }