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 @@ -46,13 +46,27 @@ enable_tmux_unit_on_boot() {
4646 fi
4747}
4848
49- main () {
49+ systemd_unit_file () {
5050 local options=" $( get_tmux_option " $auto_start_config_option " " ${auto_start_config_default} " ) "
5151 local systemd_tmux_server_start_cmd=" $( get_tmux_option " ${systemd_tmux_server_start_cmd_option} " " ${systemd_tmux_server_start_cmd_default} " ) "
5252 local tmux_start_script_path=" ${CURRENT_DIR} /linux_start_tmux.sh"
5353 local systemd_unit_file=$( template " ${tmux_start_script_path} " " ${options} " )
5454 mkdir -p " $( dirname ${systemd_unit_file_path} ) "
55- echo " $systemd_unit_file " > " ${systemd_unit_file_path} "
55+ echo " $systemd_unit_file "
56+ }
57+
58+ write_unit_file () {
59+ systemd_unit_file > " ${systemd_unit_file_path} "
60+ }
61+
62+ write_unit_file_unless_exists () {
63+ if ! [ -e " ${systemd_unit_file_path} " ]; then
64+ write_unit_file
65+ fi
66+ }
67+
68+ main () {
69+ write_unit_file_unless_exists
5670 enable_tmux_unit_on_boot
5771}
5872main
You can’t perform that action at this time.
0 commit comments