#!/usr/bin/webif-page /dev/null 2>&1 fi else validate <>|required|$FORM_enable EOF equal "$?" 0 && { save_setting cifsmount cifsmount enable "$FORM_enable" commit_settings SAVED=1 } enabled "$FORM_enable" && \ validate <>|required|$FORM_remote_host string|FORM_remote_share|@TR<>|required|$FORM_remote_share string|FORM_remote_user|@TR<>|required|$FORM_remote_user string|FORM_remote_pass|@TR<>|required|$FORM_remote_pass string|FORM_local_mountpoint|@TR<>|required|$FORM_local_mountpoint EOF equal "$?" 0 && { save_setting cifsmount cifsmount remote_host "$FORM_remote_host" save_setting cifsmount cifsmount remote_share "$FORM_remote_share" save_setting cifsmount cifsmount remote_user "$FORM_remote_user" save_setting cifsmount cifsmount remote_pass "$FORM_remote_pass" save_setting cifsmount cifsmount local_mountpoint "$FORM_local_mountpoint" commit_settings SAVED=1 enabled "$FORM_enable" && { ( lock /var/run/df_cifsmount killall N60cifsmount >/dev/null 2>&1 sleep 1 /etc/init.d/N60cifsmount lock -u /var/run/df_cifsmount )& } } enabled "$FORM_enable" || { umount /mnt/${FORM_local_mountpoint} >/dev/null 2>&1 } fi header "Mount Network Share" cat < EOF display_form <> start_select_cell|enable|$FORM_enable|tableTextSelect|enablechange option|0|@TR<> option|1|@TR<> end_select_cell end_row add_row add_button_cell|submit|@TR<>|tableTextButton end_row end_table start_div|cifssettings start_table|0|10|5 add_row add_label_cell|@TR<> add_input_cell|remote_host|$FORM_remote_host|tableTextButton end_row add_row add_label_cell|@TR<> add_input_cell|remote_share|$FORM_remote_share|tableTextButton end_row add_row add_label_cell|@TR<> add_input_cell|remote_user|$FORM_remote_user|tableTextButton end_row add_row add_label_cell|@TR<> add_input_cell|remote_pass|$FORM_remote_pass|tableTextButton end_row add_row add_label_cell|@TR<> add_input_cell|local_mountpoint|$FORM_local_mountpoint|tableTextButton add_label_cell|@TR<<"/mnt/" is prepended automatically>> end_row end_table start_table|0|10|5 add_row add_button_cell|submit|@TR<>|tableTextButton add_button_cell|umount|@TR<>|tableTextButton end_row end_table EOF if equal "$FORM_enable" "1"; then display_form <
EOF
lock -w /var/run/df_cifsmount
df -h
		cat <
EOF
		display_form <