wok diff ppp/stuff/ppp.cgi @ rev 18025

ppp/ppp.cgi: s/rtc/pstn/ , VPN submenu
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue May 05 12:04:20 2015 +0200 (2015-05-05)
parents 67380acb9c14
children ad704793e0bf
line diff
     1.1 --- a/ppp/stuff/ppp.cgi	Sat May 02 22:46:46 2015 +0200
     1.2 +++ b/ppp/stuff/ppp.cgi	Tue May 05 12:04:20 2015 +0200
     1.3 @@ -15,16 +15,23 @@
     1.4  		TEXTDOMAIN_original=$TEXTDOMAIN
     1.5  		export TEXTDOMAIN='ppp'
     1.6  
     1.7 +		case "$2" in
     1.8 +		*VPN*)
     1.9 +		[ "$(which pptp 2>/dev/null)$(which pptpd 2>/dev/null)" ] && cat <<EOT
    1.10 +<li><a data-icon="eth" href="ppp.cgi#pptp" data-root>$(_ 'PPTP')</a></li>
    1.11 +EOT
    1.12 +		[ "$(which pppssh 2>/dev/null)" ] && cat <<EOT
    1.13 +<li><a data-icon="eth" href="ppp.cgi#pppssh" data-root>$(_ 'PPP/SSH')</a></li>
    1.14 +EOT
    1.15  		cat <<EOT
    1.16 -<li><a data-icon="removable" href="ppp.cgi#ppprtc" data-root>$(_ 'PPP Modem')</a></li>
    1.17  <li><a data-icon="upgrade" href="ppp.cgi#pppnc" data-root>$(_ 'Route shortcut')</a></li>
    1.18  EOT
    1.19 -		[ "$(which pptp 2>/dev/null)$(which pptpd 2>/dev/null)" ] && cat <<EOT
    1.20 -<li><a data-icon="eth" href="ppp.cgi#pptp" data-root>$(_ 'VPN PPTP')</a></li>
    1.21 +		;;
    1.22 +		*)
    1.23 +		cat <<EOT
    1.24 +<li><a data-icon="removable" href="ppp.cgi" data-root>$(_ 'PPP Modem')</a></li>
    1.25  EOT
    1.26 -		[ "$(which pppssh 2>/dev/null)" ] && cat <<EOT
    1.27 -<li><a data-icon="eth" href="ppp.cgi#pppssh" data-root>$(_ 'VPN PPP/SSH')</a></li>
    1.28 -EOT
    1.29 +		esac
    1.30  		export TEXTDOMAIN=$TEXTDOMAIN_original
    1.31  		exit
    1.32  esac
    1.33 @@ -35,8 +42,8 @@
    1.34  #
    1.35  
    1.36  case " $(GET) " in
    1.37 -*\ setppprtc\ *)
    1.38 -	if [ "$(GET start_rtc)" -a "$(GET user)" ]; then
    1.39 +*\ setppppstn\ *)
    1.40 +	if [ "$(GET start_pstn)" -a "$(GET user)" ]; then
    1.41  		grep -s "$(GET user)" /etc/ppp/pap-secrets ||
    1.42  		echo "$(GET user)	*	$(GET pass)" >> /etc/ppp/pap-secrets
    1.43  		grep -s "$(GET user)" /etc/ppp/chap-secrets ||
    1.44 @@ -46,7 +53,7 @@
    1.45  		/etc/ppp/scripts/ppp-off
    1.46  		/etc/ppp/scripts/ppp-on &
    1.47  	fi
    1.48 -	if [ "$(GET stop_rtc)" ]; then
    1.49 +	if [ "$(GET stop_pstn)" ]; then
    1.50  		/etc/ppp/scripts/ppp-off
    1.51  	fi
    1.52  	;;
    1.53 @@ -115,7 +122,7 @@
    1.54  USERNAME="$(sed '/^name/!d;s/^[^ ]* *//' /etc/ppp/options)"
    1.55  PASSWORD="$(awk -v key=$USERNAME "\$1==key{print \$3}" /etc/ppp/pap-secrets)"
    1.56  ACCOUNT="$(sed '/^ACCOUNT=/!d;s/^.*=\([^ \t]*\).*/\1/' /etc/ppp/scripts/ppp-on)"
    1.57 -PASSRTC="$(sed '/^PASSWORD=/!d;s/^.*=\([^ \t]*\).*/\1/' /etc/ppp/scripts/ppp-on)"
    1.58 +PASSPSTN="$(sed '/^PASSWORD=/!d;s/^.*=\([^ \t]*\).*/\1/' /etc/ppp/scripts/ppp-on)"
    1.59  PHONE="$(sed '/^TELEPHONE=/!d;s/^.*=\([^ \t]*\).*/\1/' /etc/ppp/scripts/ppp-on)"
    1.60  busybox ps x | grep -v grep | grep -q pppnc_server || stops_disabled='disabled'
    1.61  busybox ps x | grep -v grep | grep -q pppnc_client || stopc_disabled='disabled'
    1.62 @@ -152,7 +159,7 @@
    1.63  	<header>
    1.64  		$(_ 'Configuration')
    1.65  	</header>
    1.66 -		<a data-icon="conf" href="index.cgi?file=/etc/ppp/scripts/ppp-on" target="_blank">$(_ 'PPP RTC script')</a><p>
    1.67 +		<a data-icon="conf" href="index.cgi?file=/etc/ppp/scripts/ppp-on" target="_blank">$(_ 'PPP PSTN script')</a><p>
    1.68  		<a data-icon="conf" href="index.cgi?file=/etc/ppp/scripts/ppp-on-dialer" target="_blank">$(_ 'PPP dailer chat')</a><p>
    1.69  		<a data-icon="conf" href="index.cgi?file=/etc/ppp/options" target="_blank">$(_ 'PPP options')</a><p>
    1.70  		<a data-icon="conf" href="index.cgi?file=/etc/ppp/chap-secrets" target="_blank">$(_ 'chap users')</a><p>
    1.71 @@ -182,14 +189,14 @@
    1.72  </section>
    1.73  </div>
    1.74  
    1.75 -<a name="ppprtc"></a>
    1.76 +<a name="ppppstn"></a>
    1.77  <section>
    1.78  	<header>
    1.79 -		<span data-icon="removable">$(_ 'RTC modem') -
    1.80 -		$(_ 'Manage RTC Internet connections')</span>
    1.81 +		<span data-icon="removable">$(_ 'PSTN modem') -
    1.82 +		$(_ 'Manage PSTN Internet connections')</span>
    1.83  	</header>
    1.84  <form action="index.cgi" id="indexform"></form>
    1.85 -<form method="get" action="?setppprtc">
    1.86 +<form method="get" action="?setppppstn">
    1.87  	<table>
    1.88  	<tr>
    1.89  		<td>$(_ 'Username')</td>
    1.90 @@ -197,7 +204,7 @@
    1.91  	</tr>
    1.92  	<tr>
    1.93  		<td>$(_ 'Password')</td>
    1.94 -		<td><input type="text" name="pass" size="40" value="$PASSRTC" /></td>
    1.95 +		<td><input type="text" name="pass" size="40" value="$PASSPSTN" /></td>
    1.96  	</tr>
    1.97  	<tr>
    1.98  		<td>$(_ 'Phone number')</td>
    1.99 @@ -206,8 +213,8 @@
   1.100  	</table>
   1.101  </form>
   1.102  	<footer><!--
   1.103 -		--><button form="conf" type="submit" name="start_rtc" data-icon="start" $start_disabled>$(_ 'Start'  )</button><!--
   1.104 -		--><button form="conf" type="submit" name="stop_rtc"  data-icon="stop"  $stop_disabled >$(_ 'Stop'   )</button><!--
   1.105 +		--><button form="conf" type="submit" name="start_pstn" data-icon="start" $start_disabled>$(_ 'Start'  )</button><!--
   1.106 +		--><button form="conf" type="submit" name="stop_pstn"  data-icon="stop"  $stop_disabled >$(_ 'Stop'   )</button><!--
   1.107  	--></footer>
   1.108  </section>
   1.109