]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Fixing usage of mktemp in shell scripts
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 20 Mar 2024 13:25:55 +0000 (14:25 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 20 Mar 2024 13:25:55 +0000 (14:25 +0100)
scripts/disabling-ldap-user
scripts/get-dns-zonefiles
scripts/get-k8s-master-configs
scripts/set-ldap-inetuserstatus

index 18254efdc443f80d6a73c3561414aa656f28f7a9..26e6262c30768e861c9493e1d6cd54e0192c504f 100755 (executable)
@@ -9,7 +9,7 @@ QUIET='n'
 SIMULATE='n'
 YES="n"
 
-VERSION="1.4"
+VERSION="1.5"
 
 # console colors:
 RED=""
@@ -914,7 +914,7 @@ main() {
     get_options "$@"
 
     debug "Creating temporary LDIF file ..."
-    LDIF_FILE=$( mktemp disable-user.XXXXXXXX.ldif )
+    LDIF_FILE=$( mktemp -t disable-user.XXXXXXXX.ldif )
     debug "Temporary file is '${CYAN}${LDIF_FILE}${NORMAL}'."
 
     trap cleanup_tmp_file INT TERM EXIT ABRT
index 1ed06a4e26001699da22d748c7e9d0b558bd9834..eb46b28f344e6290e01468f5cfbc92787a4ade1d 100755 (executable)
@@ -115,7 +115,7 @@ get_zone() {
     echo >&2
     info "Get zone '${GREEN}${zone}${NORMAL}' ..."
 
-    local tmpfile=$( mktemp "${zone}.XXXXXXXXXX.zone" )
+    local tmpfile=$( mktemp -t "${zone}.XXXXXXXXXX.zone" )
     local i=0
     local zone_file="${zone}.$( cur_ts ).${i}.zone"
     while [[ -e "${zone_file}" ]] ; do
index 9a915edd7943117cbc806904c9769ae481f8a8c3..c396aa5e1b5d982c0c02f526a6719a4688daf304 100755 (executable)
@@ -7,7 +7,7 @@ VERBOSE="n"
 DEBUG="n"
 QUIET='n'
 
-VERSION="1.0"
+VERSION="1.1"
 
 # console colors:
 RED=""
@@ -413,7 +413,7 @@ get_config() {
         return 0
     fi
 
-    TEMPFILE=$( mktemp )
+    TEMPFILE=$( mktemp -t kube.XXXXXXXXXX.config )
     debug "Temporary file is '${TEMPFILE}'."
     trap cleanup_tmp_file INT TERM EXIT ABRT
 
index 6881a6aa859b2f923abf94ce9b13a0de12c9b327..d40621bb8fe158f7d67923531564af1d69f4bf73 100755 (executable)
@@ -8,7 +8,7 @@ MY_REAL_NAME=$( readlink -f $0 )
 BIN_DIR=$( dirname "${MY_REAL_NAME}" )
 BASE_DIR=$( dirname "${BIN_DIR}" )
 
-VERSION="0.1"
+VERSION="0.2"
 
 if [[ -f "${BIN_DIR}/functions.rc" ]] ; then
     . "${BIN_DIR}/functions.rc"
@@ -462,7 +462,7 @@ main() {
     get_options "$@"
 
     debug "Creating temporary LDIF file ..."
-    LDIF_FILE=$( mktemp disable-user.XXXXXXXX.ldif )
+    LDIF_FILE=$( mktemp -t disable-user.XXXXXXXX.ldif )
     debug "Temporary file is '${CYAN}${LDIF_FILE}${NORMAL}'."
 
     trap cleanup_tmp_file INT TERM EXIT ABRT