#!/bin/sh create_mc_ini() { cat > $HOME/.mc/ini << 'EOF' [Midnight-Commander] show_backups=1 show_dot_files=1 verbose=0 mark_moves_down=1 pause_after_run=2 shell_patterns=1 auto_save_setup=1 auto_menu=0 use_internal_view=1 use_internal_edit=1 clear_before_exec=1 mix_all_files=0 fast_reload=0 fast_reload_msg_shown=0 confirm_delete=1 confirm_overwrite=1 confirm_execute=0 confirm_exit=1 safe_delete=0 mouse_repeat_rate=100 double_click_speed=250 eight_bit_clean=1 full_eight_bits=0 use_8th_bit_as_meta=1 confirm_view_dir=0 mouse_move_pages=1 mouse_move_pages_viewer=1 fast_refresh=0 navigate_with_arrows=0 drop_menus=0 wrap_mode=-1 old_esc_mode=0 cd_symlinks=1 show_all_if_ambiguous=0 have_fast_cpu=0 max_dirt_limit=10 torben_fj_mode=0 use_file_to_guess_type=1 alternate_plus_minus=0 only_leading_plus_minus=1 show_output_starts_shell=0 panel_scroll_pages=1 xtree_mode=0 num_history_items_recorded=60 file_op_compute_totals=1 vfs_timeout=60 ftpfs_directory_timeout=900 use_netrc=1 ftpfs_retry_seconds=30 ftpfs_always_use_proxy=0 ftpfs_use_passive_connections=1 ftpfs_use_unix_list_options=1 ftpfs_first_cd_then_ls=0 editor_word_wrap_line_length=72 editor_key_emulation=0 editor_tab_spacing=8 editor_fill_tabs_with_spaces=0 editor_return_does_auto_indent=1 editor_backspace_through_tabs=0 editor_fake_half_tabs=1 editor_option_save_mode=0 editor_option_save_position=1 editor_option_backup_ext_int=-1 editor_option_auto_para_formatting=0 editor_option_typewriter_wrap=0 editor_edit_confirm_save=1 editor_syntax_highlighting=1 nice_rotating_dash=1 horizontal_split=0 [Layout] equal_split=1 first_panel_size=66 message_visible=0 keybar_visible=1 xterm_title=1 output_lines=0 command_prompt=1 menubar_visible=1 show_mini_info=1 permission_mode=0 filetype_mode=1 [Dirs] other_dir=/var/mod/root current_is_left=1 [New Left Panel] display=listing reverse=0 case_sensitive=1 sort_order=name list_mode=full user_format=half type name | size | perm user_status0=half type name | size | perm user_status1=half type name | size | perm user_status2=half type name | size | perm user_status3=half type name | size | perm user_mini_status=0 [New Right Panel] display=listing reverse=0 case_sensitive=1 sort_order=name list_mode=full user_format=half type name | size | perm user_status0=half type name | size | perm user_status1=half type name | size | perm user_status2=half type name | size | perm user_status3=half type name | size | perm user_mini_status=0 [Misc] ftpfs_password=anonymous@ ftp_proxy_host=gate [terminal:vt102] f5=\e[16~ f6=\e[17~ f7=\e[18~ f8=\e[19~ f9=\e[20~ f10=\e[21~ f11=\e[23~ f12=\e[24 f13=\eO2R f14=\eO2S f15=\e[15;2~ f16=\e[17;2~ f17=\e[18;2~ f18=\e[19;2~ f19=\e[20;2~ f20=\e[21;2~ bs= end=\eOF home=\e[1~ pgdn=\e[6~ pgup=\e[5~ insert=\e[2~ delete=\e[3~ complete=\e^i kpplus=\e+ kpminus=\e- kpasterix=\e* [terminal:xterm-color] f13=\eO2R f14=\eO2S f15=\e[15;2~ f16=\e[17;2~ f17=\e[18;2~ f18=\e[19;2~ f19=\e[20;2~ f20=\e[21;2~ end=\e[4~ home=\e[1~ insert=\e[2~ kpplus=\e+ kpminus=\e- kpasterix=\e* [terminal:xterm] f13=\eO2R f14=\eO2S f15=\e[15;2~ f16=\e[17;2~ f17=\e[18;2~ f18=\e[19;2~ f19=\e[20;2~ f20=\e[21;2~ end=\e[4~ home=\e[1~ insert=\e[2~ kpplus=\e+ kpminus=\e- kpasterix=\e* [Panelize] Find *.orig after patching=find . -name \*.orig -print Find SUID and SGID programs=find . \( \( -perm -04000 -a -perm +011 \) -o \( -perm -02000 -a -perm +01 \) \) -print Find rejects after patching=find . -name \*.rej -print EOF } # Serial console -> stick chars (-a), no colour (-b), slow terminal (-s) [ "$serial_term" == "y" ] && mc_params="-abs" # TERM=foo -> look for $TERMINFO/f/foo. If not found, assume vt102. export TERMINFO=/mod/pkg/mc/usr/share/terminfo [ -f "$TERMINFO/${TERM%${TERM#?}}/$TERM" ] || export TERM=vt102 # Create defaults mkdir -p $HOME/.mc/cedit touch $HOME/.mc/hotlist $HOME/.mc/cedit/Syntax [ -e $HOME/.mc/ini ] || create_mc_ini # Set /bin/bash as subshell if it exists [ -e /bin/bash ] && export SHELL=/bin/bash exec "$0.bin" $mc_params "$@"