Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix systemd unit install on clean system #106

Merged
merged 1 commit into from
May 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions scripts/handle_tmux_automatic_start/systemd_enable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ systemd_unit_file() {
local systemd_tmux_server_start_cmd="$(get_tmux_option "${systemd_tmux_server_start_cmd_option}" "${systemd_tmux_server_start_cmd_default}" )"
local tmux_start_script_path="${CURRENT_DIR}/linux_start_tmux.sh"
local systemd_unit_file=$(template "${tmux_start_script_path}" "${options}")
mkdir -p "$(dirname ${systemd_unit_file_path})"
echo "$systemd_unit_file"
}

Expand All @@ -60,8 +59,13 @@ write_unit_file() {
}

write_unit_file_unless_exists() {
if ! [ -e "${systemd_unit_file_path}" ]; then
write_unit_file

local systemd_unit_file_dir=$(dirname ${systemd_unit_file_path})
if ! [ -d $systemd_unit_file_dir ]; then
mkdir -p $systemd_unit_file_dir
write_unit_file
elif ! [ -e "${systemd_unit_file_path}" ]; then
write_unit_file
fi
}

Expand Down