Compare commits
3 Commits
fc2f31d795
...
0ad6174ec5
Author | SHA1 | Date |
---|---|---|
Bruno Sutic | 0ad6174ec5 | |
Bruno Sutic | 64a059996f | |
Paul Elliott | 3d10915bfa |
|
@ -51,22 +51,25 @@ 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 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 tmux_start_script_path="${CURRENT_DIR}/linux_start_tmux.sh"
|
||||||
local systemd_unit_file=$(template "${tmux_start_script_path}" "${options}")
|
local systemd_unit_file=$(template "${tmux_start_script_path}" "${options}")
|
||||||
mkdir -p "$(dirname ${systemd_unit_file_path})"
|
|
||||||
echo "$systemd_unit_file"
|
echo "$systemd_unit_file"
|
||||||
}
|
}
|
||||||
|
|
||||||
write_unit_file() {
|
write_unit_file() {
|
||||||
systemd_unit_file > "${systemd_unit_file_path}"
|
systemd_unit_file > "${systemd_unit_file_path}"
|
||||||
}
|
}
|
||||||
|
|
||||||
write_unit_file_unless_exists() {
|
write_unit_file_unless_exists() {
|
||||||
if ! [ -e "${systemd_unit_file_path}" ]; then
|
local systemd_unit_file_dir=$(dirname ${systemd_unit_file_path})
|
||||||
write_unit_file
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
write_unit_file_unless_exists
|
write_unit_file_unless_exists
|
||||||
enable_tmux_unit_on_boot
|
enable_tmux_unit_on_boot
|
||||||
}
|
}
|
||||||
main
|
main
|
||||||
|
|
Loading…
Reference in New Issue