Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
fix: use temp file mktemp prior to machinectl docker
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Apr 28, 2024
1 parent f7ccbc4 commit 5528b60
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions docs/install-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ fi
export DEBIAN_FRONTEND=noninteractive

# Global Vars
TEMP_DIR=$(mktemp -d)
OS_NAME="debian"

check_user_not_root() {
Expand Down Expand Up @@ -62,7 +61,7 @@ check_user_not_root() {
if [ "${ext: -3}" = ".sh" ]; then
# User called script directly, copy to temp dir
root_script_path="$(readlink -f "$0")"
temp_script_path="${TEMP_DIR}/$(basename "$0")"
temp_script_path="$(mktemp)"
cp "$root_script_path" "$temp_script_path"
chown svchot:svchot "$temp_script_path"
chmod +x "$temp_script_path"
Expand Down

0 comments on commit 5528b60

Please sign in to comment.