File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
scripts/handle_tmux_automatic_start Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -44,13 +44,27 @@ enable_tmux_unit_on_boot() {
4444 fi
4545}
4646
47- main () {
47+ systemd_unit_file () {
4848 local options=" $( get_tmux_option " $auto_start_config_option " " ${auto_start_config_default} " ) "
4949 local systemd_tmux_server_start_cmd=" $( get_tmux_option " ${systemd_tmux_server_start_cmd_option} " " ${systemd_tmux_server_start_cmd_default} " ) "
5050 local tmux_start_script_path=" ${CURRENT_DIR} /linux_start_tmux.sh"
5151 local systemd_unit_file=$( template " ${tmux_start_script_path} " " ${options} " )
5252 mkdir -p " $( dirname ${systemd_unit_file_path} ) "
53- echo " $systemd_unit_file " > " ${systemd_unit_file_path} "
53+ echo " $systemd_unit_file "
54+ }
55+
56+ write_unit_file () {
57+ systemd_unit_file > " ${systemd_unit_file_path} "
58+ }
59+
60+ write_unit_file_unless_exists () {
61+ if ! [ -e " ${systemd_unit_file_path} " ]; then
62+ write_unit_file
63+ fi
64+ }
65+
66+ main () {
67+ write_unit_file_unless_exists
5468 enable_tmux_unit_on_boot
5569}
5670main
You can’t perform that action at this time.
0 commit comments