wok 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 e73d029d98ae
children 7810396beca8
files ppp/receipt ppp/stuff/ppp.cgi
line diff
     1.1 --- a/ppp/receipt	Sun May 03 19:46:03 2015 +0300
     1.2 +++ b/ppp/receipt	Tue May 05 12:04:20 2015 +0200
     1.3 @@ -27,13 +27,14 @@
     1.4  # Rules to gen a SliTaz package suitable for Tazpkg.
     1.5  genpkg_rules()
     1.6  {
     1.7 -	mkdir -p $fs/usr $fs/var/www/tazpanel/menu.d/network
     1.8 +	mkdir -p $fs/usr $fs/var/www/tazpanel/menu.d/network/VPN
     1.9  	cp -a $install/usr/sbin $fs/usr
    1.10  	[ -d "$install/usr/lib" ] && cp -a $install/usr/lib $fs/usr
    1.11  	cp -a $stuff/pppnc-server $fs/usr/sbin
    1.12  	ln $fs/usr/sbin/pppnc-server $fs/usr/sbin/pppnc-client
    1.13  	cp -a $stuff/ppp.cgi $fs/var/www/tazpanel
    1.14  	ln -s ../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/ppp
    1.15 +	ln -s ../../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/VPN/ppp
    1.16  	
    1.17  	# Config files.
    1.18  	mkdir -p $fs/etc/ppp/scripts $fs/etc/ppp/ip-up.d $fs/etc/ppp/ip-down.d
     2.1 --- a/ppp/stuff/ppp.cgi	Sun May 03 19:46:03 2015 +0300
     2.2 +++ b/ppp/stuff/ppp.cgi	Tue May 05 12:04:20 2015 +0200
     2.3 @@ -15,16 +15,23 @@
     2.4  		TEXTDOMAIN_original=$TEXTDOMAIN
     2.5  		export TEXTDOMAIN='ppp'
     2.6  
     2.7 +		case "$2" in
     2.8 +		*VPN*)
     2.9 +		[ "$(which pptp 2>/dev/null)$(which pptpd 2>/dev/null)" ] && cat <<EOT
    2.10 +<li><a data-icon="eth" href="ppp.cgi#pptp" data-root>$(_ 'PPTP')</a></li>
    2.11 +EOT
    2.12 +		[ "$(which pppssh 2>/dev/null)" ] && cat <<EOT
    2.13 +<li><a data-icon="eth" href="ppp.cgi#pppssh" data-root>$(_ 'PPP/SSH')</a></li>
    2.14 +EOT
    2.15  		cat <<EOT
    2.16 -<li><a data-icon="removable" href="ppp.cgi#ppprtc" data-root>$(_ 'PPP Modem')</a></li>
    2.17  <li><a data-icon="upgrade" href="ppp.cgi#pppnc" data-root>$(_ 'Route shortcut')</a></li>
    2.18  EOT
    2.19 -		[ "$(which pptp 2>/dev/null)$(which pptpd 2>/dev/null)" ] && cat <<EOT
    2.20 -<li><a data-icon="eth" href="ppp.cgi#pptp" data-root>$(_ 'VPN PPTP')</a></li>
    2.21 +		;;
    2.22 +		*)
    2.23 +		cat <<EOT
    2.24 +<li><a data-icon="removable" href="ppp.cgi" data-root>$(_ 'PPP Modem')</a></li>
    2.25  EOT
    2.26 -		[ "$(which pppssh 2>/dev/null)" ] && cat <<EOT
    2.27 -<li><a data-icon="eth" href="ppp.cgi#pppssh" data-root>$(_ 'VPN PPP/SSH')</a></li>
    2.28 -EOT
    2.29 +		esac
    2.30  		export TEXTDOMAIN=$TEXTDOMAIN_original
    2.31  		exit
    2.32  esac
    2.33 @@ -35,8 +42,8 @@
    2.34  #
    2.35  
    2.36  case " $(GET) " in
    2.37 -*\ setppprtc\ *)
    2.38 -	if [ "$(GET start_rtc)" -a "$(GET user)" ]; then
    2.39 +*\ setppppstn\ *)
    2.40 +	if [ "$(GET start_pstn)" -a "$(GET user)" ]; then
    2.41  		grep -s "$(GET user)" /etc/ppp/pap-secrets ||
    2.42  		echo "$(GET user)	*	$(GET pass)" >> /etc/ppp/pap-secrets
    2.43  		grep -s "$(GET user)" /etc/ppp/chap-secrets ||
    2.44 @@ -46,7 +53,7 @@
    2.45  		/etc/ppp/scripts/ppp-off
    2.46  		/etc/ppp/scripts/ppp-on &
    2.47  	fi
    2.48 -	if [ "$(GET stop_rtc)" ]; then
    2.49 +	if [ "$(GET stop_pstn)" ]; then
    2.50  		/etc/ppp/scripts/ppp-off
    2.51  	fi
    2.52  	;;
    2.53 @@ -115,7 +122,7 @@
    2.54  USERNAME="$(sed '/^name/!d;s/^[^ ]* *//' /etc/ppp/options)"
    2.55  PASSWORD="$(awk -v key=$USERNAME "\$1==key{print \$3}" /etc/ppp/pap-secrets)"
    2.56  ACCOUNT="$(sed '/^ACCOUNT=/!d;s/^.*=\([^ \t]*\).*/\1/' /etc/ppp/scripts/ppp-on)"
    2.57 -PASSRTC="$(sed '/^PASSWORD=/!d;s/^.*=\([^ \t]*\).*/\1/' /etc/ppp/scripts/ppp-on)"
    2.58 +PASSPSTN="$(sed '/^PASSWORD=/!d;s/^.*=\([^ \t]*\).*/\1/' /etc/ppp/scripts/ppp-on)"
    2.59  PHONE="$(sed '/^TELEPHONE=/!d;s/^.*=\([^ \t]*\).*/\1/' /etc/ppp/scripts/ppp-on)"
    2.60  busybox ps x | grep -v grep | grep -q pppnc_server || stops_disabled='disabled'
    2.61  busybox ps x | grep -v grep | grep -q pppnc_client || stopc_disabled='disabled'
    2.62 @@ -152,7 +159,7 @@
    2.63  	<header>
    2.64  		$(_ 'Configuration')
    2.65  	</header>
    2.66 -		<a data-icon="conf" href="index.cgi?file=/etc/ppp/scripts/ppp-on" target="_blank">$(_ 'PPP RTC script')</a><p>
    2.67 +		<a data-icon="conf" href="index.cgi?file=/etc/ppp/scripts/ppp-on" target="_blank">$(_ 'PPP PSTN script')</a><p>
    2.68  		<a data-icon="conf" href="index.cgi?file=/etc/ppp/scripts/ppp-on-dialer" target="_blank">$(_ 'PPP dailer chat')</a><p>
    2.69  		<a data-icon="conf" href="index.cgi?file=/etc/ppp/options" target="_blank">$(_ 'PPP options')</a><p>
    2.70  		<a data-icon="conf" href="index.cgi?file=/etc/ppp/chap-secrets" target="_blank">$(_ 'chap users')</a><p>
    2.71 @@ -182,14 +189,14 @@
    2.72  </section>
    2.73  </div>
    2.74  
    2.75 -<a name="ppprtc"></a>
    2.76 +<a name="ppppstn"></a>
    2.77  <section>
    2.78  	<header>
    2.79 -		<span data-icon="removable">$(_ 'RTC modem') -
    2.80 -		$(_ 'Manage RTC Internet connections')</span>
    2.81 +		<span data-icon="removable">$(_ 'PSTN modem') -
    2.82 +		$(_ 'Manage PSTN Internet connections')</span>
    2.83  	</header>
    2.84  <form action="index.cgi" id="indexform"></form>
    2.85 -<form method="get" action="?setppprtc">
    2.86 +<form method="get" action="?setppppstn">
    2.87  	<table>
    2.88  	<tr>
    2.89  		<td>$(_ 'Username')</td>
    2.90 @@ -197,7 +204,7 @@
    2.91  	</tr>
    2.92  	<tr>
    2.93  		<td>$(_ 'Password')</td>
    2.94 -		<td><input type="text" name="pass" size="40" value="$PASSRTC" /></td>
    2.95 +		<td><input type="text" name="pass" size="40" value="$PASSPSTN" /></td>
    2.96  	</tr>
    2.97  	<tr>
    2.98  		<td>$(_ 'Phone number')</td>
    2.99 @@ -206,8 +213,8 @@
   2.100  	</table>
   2.101  </form>
   2.102  	<footer><!--
   2.103 -		--><button form="conf" type="submit" name="start_rtc" data-icon="start" $start_disabled>$(_ 'Start'  )</button><!--
   2.104 -		--><button form="conf" type="submit" name="stop_rtc"  data-icon="stop"  $stop_disabled >$(_ 'Stop'   )</button><!--
   2.105 +		--><button form="conf" type="submit" name="start_pstn" data-icon="start" $start_disabled>$(_ 'Start'  )</button><!--
   2.106 +		--><button form="conf" type="submit" name="stop_pstn"  data-icon="stop"  $stop_disabled >$(_ 'Stop'   )</button><!--
   2.107  	--></footer>
   2.108  </section>
   2.109