From 6c3488c0fd88ab771ad085e2a1b7827c50cd2221 Mon Sep 17 00:00:00 2001 From: mike3 Date: Mon, 3 Dec 2012 22:11:09 -0500 Subject: [PATCH 01/40] VPN Shortcut added to the Boxee Browse Menu --- .../skin/boxee/720p/boxee_browse_menu.xml | 10 ++++-- .../720p/resources/icons/graphic-vpn.png | Bin 0 -> 1067 bytes .../skin/boxee/720p/scripts/boxeehack_vpn.py | 14 ++++++++ hack/vpn.sh | 33 ++++++++++++++++++ 4 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 hack/boxee/skin/boxee/720p/resources/icons/graphic-vpn.png create mode 100644 hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py create mode 100755 hack/vpn.sh diff --git a/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml b/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml index 3b2036f..6a74e49 100644 --- a/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml +++ b/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml @@ -317,9 +317,9 @@ - 534 + 518 396 - 212 + 265 56 12 200 @@ -375,10 +375,14 @@ ActivateWindow(10493) + ../720p/resources/icons/graphic-vpn.png + XBMC.RunScript("special://skin/720p/scripts/boxeehack_vpn.py", "vpn") + + mainmenu/graphic-icon-settings.png ActivateWindow(Settings) - + mainmenu/graphic-icon-exit.png ActivateWindow(111) diff --git a/hack/boxee/skin/boxee/720p/resources/icons/graphic-vpn.png b/hack/boxee/skin/boxee/720p/resources/icons/graphic-vpn.png new file mode 100644 index 0000000000000000000000000000000000000000..46a692786552ccb323d8f8bd3147a25fe9530cb9 GIT binary patch literal 1067 zcmV+`1l0S9P)DLkqUqcoKyf*fT@5`L3|a&9fW(!n{W5BO7_G`mTiIA84ZI$t8cZxS~(0n z(EIy)0v|YrFd`Zf6*LYoo^Nh$p3AaqwRYGN^ccnn#-JgaBa95j28FqZ00ewaJMNQE zfMs1l!WzKQEK=I>a}sLg0R$<$2>{>`^s2&C&>V8I@0`AK!nrZ|N$kLD3PNN)95jVd zTE>-Yx$N{;N6kSFnOFNDQxQ00Sjc`x#|m{nTG zHvOs6ul7eS_W0H%_zEH3tbS)u-!|xoT=0ZihTRLb%MXah$BqO*e|r&Xt2>pkd+gy{ z;4$qAJQA%v6@HpaA*^$|ujvm7*T7hqw+ya_BrIbtfF7PQ*JA2Irc_Xo$LSyD9;rf4 zPMhHRNXLXpFX;(&{n1Mm=wAz&P~j$hDsMUE{0kiURuslIVHmD;#_)SeYxkiU&Nu6R`0O9|l6^UFZPI4|)~AN97kKG;EZzxtt>Q{F8?ejTU-l z?g{pv8*DG4-8pe2On9(c`cd$X4P}xu;2{-*t|42;Hs~4D{gtZ2FlQ6TQYZsDF)b8G z4J{eP!kW12E{CF%q}r<)0VbNQ#*R@dwt!IIR|f4^$yESl0t2>FYWFkP?JYcWP*MsVFovn3$3J!ZTC7y(7>Q*wq95 z?<=EMPW^1`w~OW-*no;EE+k_HM#0eB*ro19m2VjFl~`Lgzls{n;0z|a8b$jm76 zU2;&gT37sSC<$;7Y&Wo&QDAY%w)7x{N(;6_pVI$a%Xky0J*3#4fvu`ceK0uW!V&C( z&H2qT2uf002ovPDHLkV1nb$>>mIC literal 0 HcmV?d00001 diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py new file mode 100644 index 0000000..6be264a --- /dev/null +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py @@ -0,0 +1,14 @@ +import os +import xbmc, xbmcgui + +def vpn_function(): + dialog = xbmcgui.Dialog() + if dialog.yesno("VPN Connection", "Connect/Disconnect VPN?"): + xbmc.executebuiltin("Notification(,Connecting/Disconnecting..,2000)") + os.system("/data/hack/vpn.sh") + +if (__name__ == "__main__"): + section = sys.argv[1] + +if section == "vpn": vpn_function() + diff --git a/hack/vpn.sh b/hack/vpn.sh new file mode 100755 index 0000000..7df7ea6 --- /dev/null +++ b/hack/vpn.sh @@ -0,0 +1,33 @@ +#!/bin/sh +##################################################### +# VPN Script for the Boxee Box v 1.0 # +# Author: n3! # +##################################################### + +# Extracts VPN details from the guisettings.xml file and stores them into the following variables below. + +host=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep server /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` +username=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep account /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` +password=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep password /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` +dgateway=`grep gateway /data/.boxee/UserData/guisettings.xml | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` + +# Checks to see if there is a current VPN connection and if it finds one it disconnects you. + +status=`ifconfig |grep ppp | busybox awk '{ print $1 }'` + + + +if [ "$status" = "" ]; then + pppd pty "pptp $host --nolaunchpppd" file /etc/ppp/options.pptp user $username password $password + sleep 2 + ppp=`ip route | grep "ppp[01]" | cut -f 1 -d " "` + route del default + route add default gw $ppp + touch /tmp/vpn.up +else + killall pptp + route add default gw $dgateway + rm /tmp/vpn.up + +fi +rm /tmp/vpn.tmp From 39bd432ab3b12e3b6ecb9dbaab711645106f7834 Mon Sep 17 00:00:00 2001 From: mike3 Date: Mon, 3 Dec 2012 22:59:03 -0500 Subject: [PATCH 02/40] modified: hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py --- hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py index 6be264a..0dd4254 100644 --- a/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py @@ -4,7 +4,7 @@ def vpn_function(): dialog = xbmcgui.Dialog() if dialog.yesno("VPN Connection", "Connect/Disconnect VPN?"): - xbmc.executebuiltin("Notification(,Connecting/Disconnecting..,2000)") + xbmc.executebuiltin("Notification(,Initiating..,2000)") os.system("/data/hack/vpn.sh") if (__name__ == "__main__"): From c72c87cfc432cd4b26b678c631c0057677ffd301 Mon Sep 17 00:00:00 2001 From: mike3 Date: Tue, 4 Dec 2012 03:57:21 -0500 Subject: [PATCH 03/40] modified: hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py --- hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py index 0dd4254..8bd8e46 100644 --- a/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py @@ -4,7 +4,7 @@ def vpn_function(): dialog = xbmcgui.Dialog() if dialog.yesno("VPN Connection", "Connect/Disconnect VPN?"): - xbmc.executebuiltin("Notification(,Initiating..,2000)") + xbmc.executebuiltin("Notification(,Initiating...,2000)") os.system("/data/hack/vpn.sh") if (__name__ == "__main__"): From 77cf725c514296d74f0f7a0fc8c582cf1235bfb4 Mon Sep 17 00:00:00 2001 From: mike3 Date: Tue, 4 Dec 2012 09:05:19 -0500 Subject: [PATCH 04/40] Updated icon --- hack/boxee/skin/boxee/720p/boxee_browse_menu.xml | 2 +- .../resources/icons/icon_browse_menu_vpn.png | Bin 0 -> 4308 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 hack/boxee/skin/boxee/720p/resources/icons/icon_browse_menu_vpn.png diff --git a/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml b/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml index 6a74e49..6e47dc1 100644 --- a/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml +++ b/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml @@ -375,7 +375,7 @@ ActivateWindow(10493) - ../720p/resources/icons/graphic-vpn.png + ../720p/resources/icons/icon_browse_menu_vpn.png XBMC.RunScript("special://skin/720p/scripts/boxeehack_vpn.py", "vpn") diff --git a/hack/boxee/skin/boxee/720p/resources/icons/icon_browse_menu_vpn.png b/hack/boxee/skin/boxee/720p/resources/icons/icon_browse_menu_vpn.png new file mode 100644 index 0000000000000000000000000000000000000000..48cd85218745d871ac901db5f47bf0aa7e5e5909 GIT binary patch literal 4308 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 Date: Tue, 4 Dec 2012 09:39:56 -0500 Subject: [PATCH 05/40] deleted: hack/boxee/skin/boxee/720p/resources/icons/graphic-vpn.png --- .../boxee/720p/resources/icons/graphic-vpn.png | Bin 1067 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 hack/boxee/skin/boxee/720p/resources/icons/graphic-vpn.png diff --git a/hack/boxee/skin/boxee/720p/resources/icons/graphic-vpn.png b/hack/boxee/skin/boxee/720p/resources/icons/graphic-vpn.png deleted file mode 100644 index 46a692786552ccb323d8f8bd3147a25fe9530cb9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1067 zcmV+`1l0S9P)DLkqUqcoKyf*fT@5`L3|a&9fW(!n{W5BO7_G`mTiIA84ZI$t8cZxS~(0n z(EIy)0v|YrFd`Zf6*LYoo^Nh$p3AaqwRYGN^ccnn#-JgaBa95j28FqZ00ewaJMNQE zfMs1l!WzKQEK=I>a}sLg0R$<$2>{>`^s2&C&>V8I@0`AK!nrZ|N$kLD3PNN)95jVd zTE>-Yx$N{;N6kSFnOFNDQxQ00Sjc`x#|m{nTG zHvOs6ul7eS_W0H%_zEH3tbS)u-!|xoT=0ZihTRLb%MXah$BqO*e|r&Xt2>pkd+gy{ z;4$qAJQA%v6@HpaA*^$|ujvm7*T7hqw+ya_BrIbtfF7PQ*JA2Irc_Xo$LSyD9;rf4 zPMhHRNXLXpFX;(&{n1Mm=wAz&P~j$hDsMUE{0kiURuslIVHmD;#_)SeYxkiU&Nu6R`0O9|l6^UFZPI4|)~AN97kKG;EZzxtt>Q{F8?ejTU-l z?g{pv8*DG4-8pe2On9(c`cd$X4P}xu;2{-*t|42;Hs~4D{gtZ2FlQ6TQYZsDF)b8G z4J{eP!kW12E{CF%q}r<)0VbNQ#*R@dwt!IIR|f4^$yESl0t2>FYWFkP?JYcWP*MsVFovn3$3J!ZTC7y(7>Q*wq95 z?<=EMPW^1`w~OW-*no;EE+k_HM#0eB*ro19m2VjFl~`Lgzls{n;0z|a8b$jm76 zU2;&gT37sSC<$;7Y&Wo&QDAY%w)7x{N(;6_pVI$a%Xky0J*3#4fvu`ceK0uW!V&C( z&H2qT2uf002ovPDHLkV1nb$>>mIC From b662755b1b8ea439abab667592eb86d4f36d6125 Mon Sep 17 00:00:00 2001 From: mike3 Date: Tue, 4 Dec 2012 18:52:46 -0500 Subject: [PATCH 06/40] VPN shortcut now does checks to see if it's configured --- .../skin/boxee/720p/scripts/boxeehack_vpn.py | 15 ++++++--- hack/vpn/vpn_check.sh | 16 ++++++++++ hack/vpn/vpn_connect.sh | 32 +++++++++++++++++++ 3 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 hack/vpn/vpn_check.sh create mode 100644 hack/vpn/vpn_connect.sh diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py index 8bd8e46..377e215 100644 --- a/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py @@ -2,10 +2,17 @@ import xbmc, xbmcgui def vpn_function(): - dialog = xbmcgui.Dialog() - if dialog.yesno("VPN Connection", "Connect/Disconnect VPN?"): - xbmc.executebuiltin("Notification(,Initiating...,2000)") - os.system("/data/hack/vpn.sh") + os.system("/data/hack/vpn/vpn_check.sh") + xbmc.sleep(400) +if os.path.exists("/tmp/vpn.enabled"): + dialog = xbmcgui.Dialog() + if dialog.yesno("VPN Connection", "Connect/Disconnect VPN?"): + xbmc.executebuiltin("Notification(,Initiating...,2000)") + os.system("/data/hack/vpn/vpn_connect.sh") + +else: + dialog = xbmcgui.Dialog() + ok = dialog.ok('VPN Connection', 'VPN has not been configured.') if (__name__ == "__main__"): section = sys.argv[1] diff --git a/hack/vpn/vpn_check.sh b/hack/vpn/vpn_check.sh new file mode 100644 index 0000000..5c7745f --- /dev/null +++ b/hack/vpn/vpn_check.sh @@ -0,0 +1,16 @@ +#!/bin/sh +##################################################### +# VPN Script for the Boxee Box v 1.0 # +# Author: n3! # +##################################################### + + +host=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep server /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` + +if [ "$host" = "" ]; then + rm /tmp/vpn.enabled +else + touch /tmp/vpn.enabled +fi + +rm /tmp/vpn.tmp diff --git a/hack/vpn/vpn_connect.sh b/hack/vpn/vpn_connect.sh new file mode 100644 index 0000000..5da4f6e --- /dev/null +++ b/hack/vpn/vpn_connect.sh @@ -0,0 +1,32 @@ +#!/bin/sh +##################################################### +# VPN Script for the Boxee Box v 1.0 # +# Author: n3! # +##################################################### + +# Extracts VPN details from the guisettings.xml file and stores them into the following variables below. + +host=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep server /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` +username=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep account /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` +password=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep password /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` +dgateway=`grep gateway /data/.boxee/UserData/guisettings.xml | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` + +# Checks to see if there is a current VPN connection and if it finds one it disconnects you. + +status=`ifconfig |grep ppp | busybox awk '{ print $1 }'` + + +if [ "$status" = "" ]; then + pppd pty "pptp $host --nolaunchpppd" file /etc/ppp/options.pptp user $username password $password + sleep 2 + ppp=`ip route | grep "ppp[01]" | cut -f 1 -d " "` + route del default + route add default gw $ppp + touch /tmp/vpn.up +else + killall pptp + route add default gw $dgateway + rm /tmp/vpn.up + +fi +rm /tmp/vpn.tmp From c02a28587218eb5b4f2b9b335b3016d4b68747c0 Mon Sep 17 00:00:00 2001 From: mike3 Date: Tue, 4 Dec 2012 18:54:02 -0500 Subject: [PATCH 07/40] modified: hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py --- hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py index 377e215..af345b9 100644 --- a/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py @@ -3,7 +3,7 @@ def vpn_function(): os.system("/data/hack/vpn/vpn_check.sh") - xbmc.sleep(400) + xbmc.sleep(100) if os.path.exists("/tmp/vpn.enabled"): dialog = xbmcgui.Dialog() if dialog.yesno("VPN Connection", "Connect/Disconnect VPN?"): From 56c2188c046bb65e7559e21e982d55bcb1f3a53f Mon Sep 17 00:00:00 2001 From: mike3 Date: Tue, 4 Dec 2012 18:55:43 -0500 Subject: [PATCH 08/40] deleted: vpn.sh --- hack/vpn.sh | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100755 hack/vpn.sh diff --git a/hack/vpn.sh b/hack/vpn.sh deleted file mode 100755 index 7df7ea6..0000000 --- a/hack/vpn.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -##################################################### -# VPN Script for the Boxee Box v 1.0 # -# Author: n3! # -##################################################### - -# Extracts VPN details from the guisettings.xml file and stores them into the following variables below. - -host=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep server /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` -username=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep account /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` -password=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep password /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` -dgateway=`grep gateway /data/.boxee/UserData/guisettings.xml | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` - -# Checks to see if there is a current VPN connection and if it finds one it disconnects you. - -status=`ifconfig |grep ppp | busybox awk '{ print $1 }'` - - - -if [ "$status" = "" ]; then - pppd pty "pptp $host --nolaunchpppd" file /etc/ppp/options.pptp user $username password $password - sleep 2 - ppp=`ip route | grep "ppp[01]" | cut -f 1 -d " "` - route del default - route add default gw $ppp - touch /tmp/vpn.up -else - killall pptp - route add default gw $dgateway - rm /tmp/vpn.up - -fi -rm /tmp/vpn.tmp From 4ca8d22517cd5dd819b766d7c57bcbf8aa1e7190 Mon Sep 17 00:00:00 2001 From: mike3 Date: Tue, 4 Dec 2012 22:36:51 -0500 Subject: [PATCH 09/40] Some more fixes --- .../skin/boxee/720p/scripts/boxeehack_vpn.py | 4 +-- hack/vpn/vpn_chk.sh | 16 ++++++++++ hack/vpn/vpn_con.sh | 32 +++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 hack/vpn/vpn_chk.sh create mode 100644 hack/vpn/vpn_con.sh diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py index af345b9..c774de6 100644 --- a/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py @@ -2,13 +2,13 @@ import xbmc, xbmcgui def vpn_function(): - os.system("/data/hack/vpn/vpn_check.sh") + os.system("/data/hack/vpn/vpn_chk.sh") xbmc.sleep(100) if os.path.exists("/tmp/vpn.enabled"): dialog = xbmcgui.Dialog() if dialog.yesno("VPN Connection", "Connect/Disconnect VPN?"): xbmc.executebuiltin("Notification(,Initiating...,2000)") - os.system("/data/hack/vpn/vpn_connect.sh") + os.system("/data/hack/vpn/vpn_con.sh") else: dialog = xbmcgui.Dialog() diff --git a/hack/vpn/vpn_chk.sh b/hack/vpn/vpn_chk.sh new file mode 100644 index 0000000..1497ef1 --- /dev/null +++ b/hack/vpn/vpn_chk.sh @@ -0,0 +1,16 @@ +#!/bin/sh +##################################################### +# VPN Script for the Boxee Box v 1.0 # +# Author: n3! # +##################################################### + + +host=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep server /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` + +if [ "$host" = "" ]; then + rm /data/hack/vpn/vpn.enabled +else + touch /data/hack/vpn/vpn.enabled +fi + +rm /tmp/vpn.tmp diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh new file mode 100644 index 0000000..5da4f6e --- /dev/null +++ b/hack/vpn/vpn_con.sh @@ -0,0 +1,32 @@ +#!/bin/sh +##################################################### +# VPN Script for the Boxee Box v 1.0 # +# Author: n3! # +##################################################### + +# Extracts VPN details from the guisettings.xml file and stores them into the following variables below. + +host=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep server /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` +username=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep account /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` +password=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep password /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` +dgateway=`grep gateway /data/.boxee/UserData/guisettings.xml | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` + +# Checks to see if there is a current VPN connection and if it finds one it disconnects you. + +status=`ifconfig |grep ppp | busybox awk '{ print $1 }'` + + +if [ "$status" = "" ]; then + pppd pty "pptp $host --nolaunchpppd" file /etc/ppp/options.pptp user $username password $password + sleep 2 + ppp=`ip route | grep "ppp[01]" | cut -f 1 -d " "` + route del default + route add default gw $ppp + touch /tmp/vpn.up +else + killall pptp + route add default gw $dgateway + rm /tmp/vpn.up + +fi +rm /tmp/vpn.tmp From 6729af2d657e558faee27bfffc460484cb4e5345 Mon Sep 17 00:00:00 2001 From: mike3 Date: Tue, 4 Dec 2012 22:38:18 -0500 Subject: [PATCH 10/40] deleted: hack/vpn/vpn_check.sh deleted: hack/vpn/vpn_connect.sh --- hack/vpn/vpn_check.sh | 16 ---------------- hack/vpn/vpn_connect.sh | 32 -------------------------------- 2 files changed, 48 deletions(-) delete mode 100644 hack/vpn/vpn_check.sh delete mode 100644 hack/vpn/vpn_connect.sh diff --git a/hack/vpn/vpn_check.sh b/hack/vpn/vpn_check.sh deleted file mode 100644 index 5c7745f..0000000 --- a/hack/vpn/vpn_check.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -##################################################### -# VPN Script for the Boxee Box v 1.0 # -# Author: n3! # -##################################################### - - -host=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep server /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` - -if [ "$host" = "" ]; then - rm /tmp/vpn.enabled -else - touch /tmp/vpn.enabled -fi - -rm /tmp/vpn.tmp diff --git a/hack/vpn/vpn_connect.sh b/hack/vpn/vpn_connect.sh deleted file mode 100644 index 5da4f6e..0000000 --- a/hack/vpn/vpn_connect.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -##################################################### -# VPN Script for the Boxee Box v 1.0 # -# Author: n3! # -##################################################### - -# Extracts VPN details from the guisettings.xml file and stores them into the following variables below. - -host=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep server /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` -username=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep account /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` -password=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep password /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` -dgateway=`grep gateway /data/.boxee/UserData/guisettings.xml | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` - -# Checks to see if there is a current VPN connection and if it finds one it disconnects you. - -status=`ifconfig |grep ppp | busybox awk '{ print $1 }'` - - -if [ "$status" = "" ]; then - pppd pty "pptp $host --nolaunchpppd" file /etc/ppp/options.pptp user $username password $password - sleep 2 - ppp=`ip route | grep "ppp[01]" | cut -f 1 -d " "` - route del default - route add default gw $ppp - touch /tmp/vpn.up -else - killall pptp - route add default gw $dgateway - rm /tmp/vpn.up - -fi -rm /tmp/vpn.tmp From 249fdc74b7bfa8ca030124749a6103106c722ad6 Mon Sep 17 00:00:00 2001 From: mike3 Date: Tue, 4 Dec 2012 22:43:28 -0500 Subject: [PATCH 11/40] fixes --- hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py index c774de6..386d5f7 100644 --- a/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py @@ -4,7 +4,7 @@ def vpn_function(): os.system("/data/hack/vpn/vpn_chk.sh") xbmc.sleep(100) -if os.path.exists("/tmp/vpn.enabled"): +if os.path.exists("/data/hack/vpn/vpn.enabled"): dialog = xbmcgui.Dialog() if dialog.yesno("VPN Connection", "Connect/Disconnect VPN?"): xbmc.executebuiltin("Notification(,Initiating...,2000)") From 15fec5cc721641af20d8eb3a70e51411df0f74e1 Mon Sep 17 00:00:00 2001 From: mike3 Date: Wed, 5 Dec 2012 10:03:21 -0500 Subject: [PATCH 12/40] modified: hack/vpn/vpn_chk.sh modified: hack/vpn/vpn_con.sh --- hack/vpn/vpn_chk.sh | 0 hack/vpn/vpn_con.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 hack/vpn/vpn_chk.sh mode change 100644 => 100755 hack/vpn/vpn_con.sh diff --git a/hack/vpn/vpn_chk.sh b/hack/vpn/vpn_chk.sh old mode 100644 new mode 100755 diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh old mode 100644 new mode 100755 From 4ca2ecb3773dc8bea1ede03be859ed8465bbad56 Mon Sep 17 00:00:00 2001 From: mike3 Date: Sat, 8 Dec 2012 07:35:28 -0500 Subject: [PATCH 13/40] MTU fixes --- hack/vpn/vpn_con.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index 5da4f6e..f3c32da 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -18,10 +18,12 @@ status=`ifconfig |grep ppp | busybox awk '{ print $1 }'` if [ "$status" = "" ]; then pppd pty "pptp $host --nolaunchpppd" file /etc/ppp/options.pptp user $username password $password - sleep 2 + sleep 3 ppp=`ip route | grep "ppp[01]" | cut -f 1 -d " "` route del default - route add default gw $ppp + route add default gw $pp + ifconfig eth0 mtu 1460 + ifconfig ppp0 mtu 1400p touch /tmp/vpn.up else killall pptp From 4b492c589016cc7f85477a1785ad3ccc9ef12219 Mon Sep 17 00:00:00 2001 From: mike3 Date: Sat, 8 Dec 2012 07:51:50 -0500 Subject: [PATCH 14/40] modified: vpn_con.sh --- hack/vpn/vpn_con.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index f3c32da..1faed15 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -22,8 +22,7 @@ if [ "$status" = "" ]; then ppp=`ip route | grep "ppp[01]" | cut -f 1 -d " "` route del default route add default gw $pp - ifconfig eth0 mtu 1460 - ifconfig ppp0 mtu 1400p + ifconfig ppp0 mtu 1400 touch /tmp/vpn.up else killall pptp From ea8bae27024e7fd85af5c9a8efa08baeb84dda3b Mon Sep 17 00:00:00 2001 From: mike3 Date: Mon, 10 Dec 2012 09:06:51 -0500 Subject: [PATCH 15/40] modified: hack/vpn/vpn_con.sh --- hack/vpn/vpn_con.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index 1faed15..9afffaf 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -22,11 +22,13 @@ if [ "$status" = "" ]; then ppp=`ip route | grep "ppp[01]" | cut -f 1 -d " "` route del default route add default gw $pp + ifconfig eth0 1460 ifconfig ppp0 mtu 1400 touch /tmp/vpn.up else killall pptp route add default gw $dgateway + ifconfig eth0 1500 rm /tmp/vpn.up fi From e6a8c12d6109b8c1b8bb745d4d92dcc011850477 Mon Sep 17 00:00:00 2001 From: mike3 Date: Mon, 10 Dec 2012 09:45:04 -0500 Subject: [PATCH 16/40] Enabling visiability of VPN Shortcut - TESTING --- hack/boxee/skin/boxee/720p/boxee_browse_menu.xml | 1 + hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml | 6 ++++++ hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml b/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml index ffb6bc7..4870fda 100644 --- a/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml +++ b/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml @@ -407,6 +407,7 @@ ActivateWindow(10493) + StringCompare(Skin.String(homeenabled-vpnshortcut),1) ../720p/resources/icons/icon_browse_menu_vpn.png XBMC.RunScript("special://skin/720p/scripts/boxeehack_vpn.py", "vpn") diff --git a/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml b/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml index 83d5850..e2050d1 100644 --- a/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml +++ b/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml @@ -212,6 +212,12 @@ StringCompare(Skin.String(homeenabled-web),1) XBMC.RunScript("special://skin/720p/scripts/boxeehack_settings.py", "homeenabled", "web") + + SettingsRadioButton + + StringCompare(Skin.String(homeenabled-vpnshortcut),1) + XBMC.RunScript("special://skin/720p/scripts/boxeehack_settings.py", "homeenabled", "vpnshortcut") + diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py index 45e2198..b5cd052 100644 --- a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py @@ -334,4 +334,4 @@ def check_new_version(): if command == "featured_previous": featured_previous() if command == "showmusic": showmusic_function() if command == "homeenabled": toggle_homeenabled(sys.argv[2]) - if command == "browser-homepage": set_browser_homepage() \ No newline at end of file + if command == "browser-homepage": set_browser_homepage() From c85c0e65100ae9763c35e1a12f4cbb75a9f04384 Mon Sep 17 00:00:00 2001 From: mike3 Date: Mon, 10 Dec 2012 10:39:08 -0500 Subject: [PATCH 17/40] fixed broken script --- hack/vpn/vpn_con.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index 9afffaf..c9d87f7 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -21,7 +21,7 @@ if [ "$status" = "" ]; then sleep 3 ppp=`ip route | grep "ppp[01]" | cut -f 1 -d " "` route del default - route add default gw $pp + route add default gw $ppp ifconfig eth0 1460 ifconfig ppp0 mtu 1400 touch /tmp/vpn.up From e3b0a6344158e65beb3e17ad1e63d3af89580b30 Mon Sep 17 00:00:00 2001 From: mike3 Date: Mon, 10 Dec 2012 13:43:20 -0500 Subject: [PATCH 18/40] Making changes --- hack/boxee/skin/boxee/720p/boxee_browse_menu.xml | 2 +- hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml | 13 +++++++------ .../skin/boxee/720p/scripts/boxeehack_settings.py | 13 +++++++++++++ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml b/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml index 4870fda..746db83 100644 --- a/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml +++ b/hack/boxee/skin/boxee/720p/boxee_browse_menu.xml @@ -407,7 +407,7 @@ ActivateWindow(10493) - StringCompare(Skin.String(homeenabled-vpnshortcut),1) + StringCompare(Skin.String(showvpn),1) ../720p/resources/icons/icon_browse_menu_vpn.png XBMC.RunScript("special://skin/720p/scripts/boxeehack_vpn.py", "vpn") diff --git a/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml b/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml index e2050d1..d39952c 100644 --- a/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml +++ b/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml @@ -105,6 +105,13 @@ $INFO[Skin.String(boxeeplus-version)] XBMC.RunScript("special://skin/720p/scripts/boxeehack_settings.py", "version") + + SettingsRadioButton + + StringCompare(Skin.String(showvpn),1) + XBMC.RunScript("special://skin/720p/scripts/boxeehack_settings.py", "showvpn") + + @@ -212,12 +219,6 @@ StringCompare(Skin.String(homeenabled-web),1) XBMC.RunScript("special://skin/720p/scripts/boxeehack_settings.py", "homeenabled", "web") - - SettingsRadioButton - - StringCompare(Skin.String(homeenabled-vpnshortcut),1) - XBMC.RunScript("special://skin/720p/scripts/boxeehack_settings.py", "homeenabled", "vpnshortcut") - diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py index b5cd052..eadc4da 100644 --- a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py @@ -195,6 +195,18 @@ def showmusic_function(): xbmc.executebuiltin("Skin.SetString(showmusic,%s)" % showmusic) file_put_contents("/data/etc/.showmusic_enabled", showmusic) + +# Hide / Show VPN Shortcut icon +def showvpn_function(): + showvpn = file_get_contents("/data/etc/.showvpn_enabled") + + if showvpn == "1": + showvpn = "0" + else: + showvpn = "1" + + xbmc.executebuiltin("Skin.SetString(showvpn,%s)" % showvpn) + file_put_contents("/data/etc/.showvpn_enabled", showvpn) # Enable/disable the subtitle functionality def toggle_subtitles(mode, current): @@ -335,3 +347,4 @@ def check_new_version(): if command == "showmusic": showmusic_function() if command == "homeenabled": toggle_homeenabled(sys.argv[2]) if command == "browser-homepage": set_browser_homepage() + if command == "showvpn": showvpn_function() From 0c8e43aba7a81f12215d9f2892e8f8dd20dc10f3 Mon Sep 17 00:00:00 2001 From: mike3 Date: Mon, 10 Dec 2012 18:05:38 -0500 Subject: [PATCH 19/40] Fixed MTU - Was breaking stuff --- hack/vpn/vpn_con.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index c9d87f7..2fe037c 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -22,13 +22,13 @@ if [ "$status" = "" ]; then ppp=`ip route | grep "ppp[01]" | cut -f 1 -d " "` route del default route add default gw $ppp - ifconfig eth0 1460 +# ifconfig eth0 1460 (Breaks the VPN Connection) ifconfig ppp0 mtu 1400 touch /tmp/vpn.up else killall pptp route add default gw $dgateway - ifconfig eth0 1500 +# ifconfig eth0 1500 (Breaks VPN Connection rm /tmp/vpn.up fi From e54b7e8a1b787103d68efd1a4e1f796e5f5e4b81 Mon Sep 17 00:00:00 2001 From: mike3 Date: Mon, 10 Dec 2012 20:18:39 -0500 Subject: [PATCH 20/40] Adjustment to placement of VPN Shortcut option --- hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml b/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml index d39952c..0d4cc0c 100644 --- a/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml +++ b/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml @@ -99,18 +99,18 @@ StringCompare(Skin.String(subtitles-plugin),1) XBMC.RunScript("special://skin/720p/scripts/boxeehack_settings.py", "subtitles", "all", "all") - - SettingsButton - - $INFO[Skin.String(boxeeplus-version)] - XBMC.RunScript("special://skin/720p/scripts/boxeehack_settings.py", "version") - - + SettingsRadioButton StringCompare(Skin.String(showvpn),1) XBMC.RunScript("special://skin/720p/scripts/boxeehack_settings.py", "showvpn") + + SettingsButton + + $INFO[Skin.String(boxeeplus-version)] + XBMC.RunScript("special://skin/720p/scripts/boxeehack_settings.py", "version") + From bb9e11bed83657894e999316b341c96d125bdb41 Mon Sep 17 00:00:00 2001 From: mike3 Date: Wed, 12 Dec 2012 21:46:10 -0500 Subject: [PATCH 21/40] Incorporating VPN scripts --- hack/boot.sh | 0 hack/splash.sh | 0 hack/vpn/vpn_con.sh | 36 +++++++++++++++++++++++++++++++++--- 3 files changed, 33 insertions(+), 3 deletions(-) mode change 100644 => 100755 hack/boot.sh mode change 100644 => 100755 hack/splash.sh diff --git a/hack/boot.sh b/hack/boot.sh old mode 100644 new mode 100755 diff --git a/hack/splash.sh b/hack/splash.sh old mode 100644 new mode 100755 diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index 2fe037c..e656900 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -22,14 +22,44 @@ if [ "$status" = "" ]; then ppp=`ip route | grep "ppp[01]" | cut -f 1 -d " "` route del default route add default gw $ppp -# ifconfig eth0 1460 (Breaks the VPN Connection) - ifconfig ppp0 mtu 1400 touch /tmp/vpn.up + +# First make sure the ppp connection actually exists, and then wait till it +# is actually up (detected by checking when its default MTU gets set) + + RESULT="" + while [ "${RESULT}" == ""]; + do + sleep 1 + PPP="`ifconfig -a | grep -A 6`" + if [ "${PPP}" == "" ]; then + RESULT="fail" + else + RESULT="`ifconfig -a | grep -A 6 ppp0 | grep MTU:1496`" + fi + done + +# If the connection is up, and it didn't fail then we change the MTU + if [ "${RESULT}" != "fail" ]; then + # ifconfig eth0 mtu 1460 + ifconfig ppp0 mtu 1400 + fi + else + killall pptp route add default gw $dgateway -# ifconfig eth0 1500 (Breaks VPN Connection rm /tmp/vpn.up +# Wait and make sure the PPP connection is down again first + PPP="`ifconfig -a | grep -A 6`" + while [ "${PPP}" != "" ]; + do + sleep 1 + PPP="`ifconfig -a | grep -A 6`" + done + + ifconfig eth0 mtu 1500 + fi rm /tmp/vpn.tmp From 9d8c9d759bad6cbb0da65033aba849ed26cc8dd0 Mon Sep 17 00:00:00 2001 From: mike3 Date: Wed, 12 Dec 2012 22:02:31 -0500 Subject: [PATCH 22/40] Reverted back to original for now --- hack/vpn/vpn_con.sh | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index e656900..ad07abd 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -24,42 +24,10 @@ if [ "$status" = "" ]; then route add default gw $ppp touch /tmp/vpn.up -# First make sure the ppp connection actually exists, and then wait till it -# is actually up (detected by checking when its default MTU gets set) - - RESULT="" - while [ "${RESULT}" == ""]; - do - sleep 1 - PPP="`ifconfig -a | grep -A 6`" - if [ "${PPP}" == "" ]; then - RESULT="fail" - else - RESULT="`ifconfig -a | grep -A 6 ppp0 | grep MTU:1496`" - fi - done - -# If the connection is up, and it didn't fail then we change the MTU - if [ "${RESULT}" != "fail" ]; then - # ifconfig eth0 mtu 1460 - ifconfig ppp0 mtu 1400 - fi - else - killall pptp route add default gw $dgateway rm /tmp/vpn.up -# Wait and make sure the PPP connection is down again first - PPP="`ifconfig -a | grep -A 6`" - while [ "${PPP}" != "" ]; - do - sleep 1 - PPP="`ifconfig -a | grep -A 6`" - done - - ifconfig eth0 mtu 1500 - fi rm /tmp/vpn.tmp From be1c010029325e1b32f274cc7c61ecf7c7266e2e Mon Sep 17 00:00:00 2001 From: mike3 Date: Wed, 12 Dec 2012 22:28:44 -0500 Subject: [PATCH 23/40] modified: vpn_con.sh --- hack/vpn/vpn_con.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index ad07abd..ef1d55a 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -17,17 +17,19 @@ status=`ifconfig |grep ppp | busybox awk '{ print $1 }'` if [ "$status" = "" ]; then - pppd pty "pptp $host --nolaunchpppd" file /etc/ppp/options.pptp user $username password $password - sleep 3 - ppp=`ip route | grep "ppp[01]" | cut -f 1 -d " "` - route del default - route add default gw $ppp - touch /tmp/vpn.up - + pppd pty "pptp $host --nolaunchpppd" file /etc/ppp/options.pptp user $username password $password + sleep 3 + ppp=`ip route | grep "ppp[01]" | cut -f 1 -d " "` + route del default + route add default gw $ppp +# ifconfig eth0 1460 (Breaks the VPN Connection) + ifconfig ppp0 mtu 1400 + touch /tmp/vpn.up else - killall pptp - route add default gw $dgateway - rm /tmp/vpn.up + killall pptp + route add default gw $dgateway +# ifconfig eth0 1500 (Breaks VPN Connection + rm /tmp/vpn.up fi rm /tmp/vpn.tmp From 8e9b317b389317a94dcd837baa66828ab9eb24b9 Mon Sep 17 00:00:00 2001 From: mike3 Date: Wed, 12 Dec 2012 22:31:28 -0500 Subject: [PATCH 24/40] Just small change --- hack/vpn/vpn_con.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index ef1d55a..72fab5e 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -26,8 +26,8 @@ if [ "$status" = "" ]; then ifconfig ppp0 mtu 1400 touch /tmp/vpn.up else - killall pptp route add default gw $dgateway + killall pptp # ifconfig eth0 1500 (Breaks VPN Connection rm /tmp/vpn.up From 681efd4a0f1a1a184f15204aae6e2b7c9ba930c9 Mon Sep 17 00:00:00 2001 From: mike3 Date: Wed, 12 Dec 2012 22:37:55 -0500 Subject: [PATCH 25/40] Some more small changes --- hack/vpn/vpn_con.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index 72fab5e..80112ac 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -20,15 +20,18 @@ if [ "$status" = "" ]; then pppd pty "pptp $host --nolaunchpppd" file /etc/ppp/options.pptp user $username password $password sleep 3 ppp=`ip route | grep "ppp[01]" | cut -f 1 -d " "` - route del default - route add default gw $ppp -# ifconfig eth0 1460 (Breaks the VPN Connection) - ifconfig ppp0 mtu 1400 - touch /tmp/vpn.up + if [ "$ppp" = ""]; then + echo "Failed!" + else + route del default + route add default gw $ppp + ifconfig ppp0 mtu 1400 + touch /tmp/vpn.up + fi + else route add default gw $dgateway killall pptp -# ifconfig eth0 1500 (Breaks VPN Connection rm /tmp/vpn.up fi From 3476490eaebc9060eaa299810dd5a974ebd9ee01 Mon Sep 17 00:00:00 2001 From: mike3 Date: Wed, 12 Dec 2012 23:15:19 -0500 Subject: [PATCH 26/40] more fixes --- hack/vpn/vpn_con.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index 80112ac..d154717 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -15,12 +15,11 @@ dgateway=`grep gateway /data/.boxee/UserData/guisettings.xml | awk -F'>' '{print status=`ifconfig |grep ppp | busybox awk '{ print $1 }'` - if [ "$status" = "" ]; then pppd pty "pptp $host --nolaunchpppd" file /etc/ppp/options.pptp user $username password $password sleep 3 - ppp=`ip route | grep "ppp[01]" | cut -f 1 -d " "` - if [ "$ppp" = ""]; then + ppp=`ifconfig |grep -A 6 ppp[01] |grep addr: | cut -f 2 -d ":" | cut -f 1 -d " "` + if [ "$ppp" = "" ]; then echo "Failed!" else route del default @@ -30,8 +29,8 @@ if [ "$status" = "" ]; then fi else - route add default gw $dgateway killall pptp + route add default gw $dgateway rm /tmp/vpn.up fi From 7c357eea1e6062eaaf17ba0b68095f503e4e9492 Mon Sep 17 00:00:00 2001 From: mike3 Date: Wed, 12 Dec 2012 23:24:38 -0500 Subject: [PATCH 27/40] Revised scripts --- hack/vpn/vpn_con.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index d154717..e5a53f7 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -22,6 +22,7 @@ if [ "$status" = "" ]; then if [ "$ppp" = "" ]; then echo "Failed!" else + dgateway=`ip route | grep default | grep "eth[01]" | cut -f 3 -d " " > /data/hack/vpn/.gw` route del default route add default gw $ppp ifconfig ppp0 mtu 1400 @@ -29,8 +30,9 @@ if [ "$status" = "" ]; then fi else + dgw=`cat /data/hack/vpn/.gw` killall pptp - route add default gw $dgateway + route add default gw $dgw rm /tmp/vpn.up fi From 728f15436a6b9ee0749ca4c6af98f2ab4bb878a6 Mon Sep 17 00:00:00 2001 From: mike3 Date: Wed, 12 Dec 2012 23:29:58 -0500 Subject: [PATCH 28/40] yet another fix --- hack/vpn/vpn_con.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index e5a53f7..ee9f85c 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -22,7 +22,7 @@ if [ "$status" = "" ]; then if [ "$ppp" = "" ]; then echo "Failed!" else - dgateway=`ip route | grep default | grep "eth[01]" | cut -f 3 -d " " > /data/hack/vpn/.gw` + ip route | grep default | grep "eth[01]" | cut -f 3 -d " " > /data/hack/vpn/.gw route del default route add default gw $ppp ifconfig ppp0 mtu 1400 From 32bee254d2cafc165375ff5c9c6b919be78355f4 Mon Sep 17 00:00:00 2001 From: mike3 Date: Tue, 18 Dec 2012 09:11:32 -0500 Subject: [PATCH 29/40] modified: hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py --- hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py index 5a5eb68..007668a 100644 --- a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py @@ -180,8 +180,7 @@ def showmusic_function(): showmusic = "1" xbmc.executebuiltin("Skin.SetString(showmusic,%s)" % showmusic) -<<<<<<< HEAD - file_put_contents("/data/etc/.showmusic_enabled", showmusic) + common.file_put_contents("/data/etc/.showmusic_enabled", showmusic) # Hide / Show VPN Shortcut icon def showvpn_function(): @@ -194,9 +193,6 @@ def showvpn_function(): xbmc.executebuiltin("Skin.SetString(showvpn,%s)" % showvpn) file_put_contents("/data/etc/.showvpn_enabled", showvpn) -======= - common.file_put_contents("/data/etc/.showmusic_enabled", showmusic) ->>>>>>> upstream/development # Enable/disable the subtitle functionality def toggle_subtitles(mode, current): From b10232375e85f85cae3e4039be9e7deb83c47872 Mon Sep 17 00:00:00 2001 From: mike3 Date: Tue, 18 Dec 2012 20:15:50 -0500 Subject: [PATCH 30/40] modified: hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py --- hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py index 007668a..002be96 100644 --- a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py @@ -184,7 +184,7 @@ def showmusic_function(): # Hide / Show VPN Shortcut icon def showvpn_function(): - showvpn = file_get_contents("/data/etc/.showvpn_enabled") + showvpn = common.file_put_contents("/data/etc/.showvpn_enabled") if showvpn == "1": showvpn = "0" @@ -192,7 +192,7 @@ def showvpn_function(): showvpn = "1" xbmc.executebuiltin("Skin.SetString(showvpn,%s)" % showvpn) - file_put_contents("/data/etc/.showvpn_enabled", showvpn) + common.file_put_contents("/data/etc/.showvpn_enabled", showvpn) # Enable/disable the subtitle functionality def toggle_subtitles(mode, current): From 92ed5651c1b3ccf2e0c571ff16e91b3e0c5ec2e3 Mon Sep 17 00:00:00 2001 From: mike3 Date: Tue, 18 Dec 2012 20:30:07 -0500 Subject: [PATCH 31/40] Fixed VPN scripts to reflect changes --- hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py index 002be96..da07956 100644 --- a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py @@ -184,7 +184,7 @@ def showmusic_function(): # Hide / Show VPN Shortcut icon def showvpn_function(): - showvpn = common.file_put_contents("/data/etc/.showvpn_enabled") + showvpn = common.file_get_contents("/data/etc/.showvpn_enabled") if showvpn == "1": showvpn = "0" From dc49c9c91f17fd34572ba1d679fa55e1217f06d1 Mon Sep 17 00:00:00 2001 From: mike3 Date: Thu, 20 Dec 2012 06:03:22 -0500 Subject: [PATCH 32/40] Fixes --- hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py index 386d5f7..a8aa6ae 100644 --- a/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_vpn.py @@ -2,13 +2,13 @@ import xbmc, xbmcgui def vpn_function(): - os.system("/data/hack/vpn/vpn_chk.sh") + os.system("sh /data/hack/vpn/vpn_chk.sh") xbmc.sleep(100) if os.path.exists("/data/hack/vpn/vpn.enabled"): dialog = xbmcgui.Dialog() if dialog.yesno("VPN Connection", "Connect/Disconnect VPN?"): xbmc.executebuiltin("Notification(,Initiating...,2000)") - os.system("/data/hack/vpn/vpn_con.sh") + os.system("sh /data/hack/vpn/vpn_con.sh") else: dialog = xbmcgui.Dialog() From edb1a8e662173dd7afd493368a80cc012eff47a1 Mon Sep 17 00:00:00 2001 From: mike3 Date: Mon, 31 Dec 2012 06:16:05 -0500 Subject: [PATCH 33/40] modified: custom_BoxeeHack.xml modified: scripts/boxeehack_settings.py --- .../skin/boxee/720p/custom_BoxeeHack.xml | 13 +++++------ .../boxee/720p/scripts/boxeehack_settings.py | 22 ++----------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml b/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml index 4dc038e..8bae383 100644 --- a/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml +++ b/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml @@ -101,17 +101,16 @@ SettingsRadioButton -<<<<<<< HEAD - - StringCompare(Skin.String(showvpn),1) - XBMC.RunScript("special://skin/720p/scripts/boxeehack_settings.py", "showvpn") -======= StringCompare(Skin.String(jump-to-unwatched),1) XBMC.RunScript("special://skin/720p/scripts/boxeehack_settings.py", "toggle-jump-to-last-unwatched") ->>>>>>> upstream/development - + + + StringCompare(Skin.String(showvpn),1) + XBMC.RunScript("special://skin/720p/scripts/boxeehack_settings.py", "showvpn") + + SettingsButton $INFO[Skin.String(boxeeplus-version)] diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py index a5453e0..181f038 100644 --- a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py @@ -256,19 +256,6 @@ def get_featured_feed_value(): replace = "0" return replace -<<<<<<< HEAD -# Hide / Show Music icon -def showmusic_function(): - showmusic = common.file_get_contents("/data/etc/.showmusic_enabled") - - if showmusic == "1": - showmusic = "0" - else: - showmusic = "1" - - xbmc.executebuiltin("Skin.SetString(showmusic,%s)" % showmusic) - common.file_put_contents("/data/etc/.showmusic_enabled", showmusic) - # Hide / Show VPN Shortcut icon def showvpn_function(): showvpn = common.file_get_contents("/data/etc/.showvpn_enabled") @@ -280,9 +267,7 @@ def showvpn_function(): xbmc.executebuiltin("Skin.SetString(showvpn,%s)" % showvpn) common.file_put_contents("/data/etc/.showvpn_enabled", showvpn) - -======= ->>>>>>> upstream/development + # Enable/disable the subtitle functionality def toggle_subtitles(mode, current): if mode == "all": @@ -425,8 +410,5 @@ def check_new_version(): if command == "homeenabled": toggle_homeenabled(sys.argv[2], "") if command == "browser-homepage": set_browser_homepage() -<<<<<<< HEAD - if command == "showvpn": showvpn_function() -======= if command == "toggle-jump-to-last-unwatched": toggle_jump_to_last_unwatched() ->>>>>>> upstream/development + if command == "showvpn": showvpn_function() From 942fe39e116ac71b2cd99916432ef85134538f89 Mon Sep 17 00:00:00 2001 From: mike3 Date: Mon, 31 Dec 2012 06:37:25 -0500 Subject: [PATCH 34/40] modified: custom_BoxeeHack.xml --- hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml b/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml index 8bae383..41bd7e9 100644 --- a/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml +++ b/hack/boxee/skin/boxee/720p/custom_BoxeeHack.xml @@ -106,6 +106,7 @@ XBMC.RunScript("special://skin/720p/scripts/boxeehack_settings.py", "toggle-jump-to-last-unwatched") + SettingsRadioButton StringCompare(Skin.String(showvpn),1) XBMC.RunScript("special://skin/720p/scripts/boxeehack_settings.py", "showvpn") From 5d68513b5bfa5ad8f94f88a433247b41e41beb2d Mon Sep 17 00:00:00 2001 From: mike3 Date: Thu, 3 Jan 2013 12:58:00 -0500 Subject: [PATCH 35/40] modified: vpn_con.sh --- hack/vpn/vpn_con.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index ee9f85c..868d97c 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -1,15 +1,12 @@ #!/bin/sh -##################################################### -# VPN Script for the Boxee Box v 1.0 # -# Author: n3! # -##################################################### +# +# Author: n3! # Extracts VPN details from the guisettings.xml file and stores them into the following variables below. host=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep server /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` username=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep account /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` password=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep password /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` -dgateway=`grep gateway /data/.boxee/UserData/guisettings.xml | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` # Checks to see if there is a current VPN connection and if it finds one it disconnects you. From 85141b817b77ecc5916f03a590bdd4b183f65140 Mon Sep 17 00:00:00 2001 From: mike3 Date: Thu, 3 Jan 2013 13:00:39 -0500 Subject: [PATCH 36/40] modified: hack/vpn/vpn_chk.sh modified: hack/vpn/vpn_con.sh --- hack/vpn/vpn_chk.sh | 10 ++++------ hack/vpn/vpn_con.sh | 8 ++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/hack/vpn/vpn_chk.sh b/hack/vpn/vpn_chk.sh index 1497ef1..6732480 100755 --- a/hack/vpn/vpn_chk.sh +++ b/hack/vpn/vpn_chk.sh @@ -1,11 +1,9 @@ #!/bin/sh -##################################################### -# VPN Script for the Boxee Box v 1.0 # -# Author: n3! # -##################################################### +# +# Author: n3! -host=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep server /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` +host=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn_chk.tmp | grep server /tmp/vpn_chk.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` if [ "$host" = "" ]; then rm /data/hack/vpn/vpn.enabled @@ -13,4 +11,4 @@ else touch /data/hack/vpn/vpn.enabled fi -rm /tmp/vpn.tmp +rm /tmp/vpn_chk.tmp diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index 868d97c..47b350f 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -4,9 +4,9 @@ # Extracts VPN details from the guisettings.xml file and stores them into the following variables below. -host=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep server /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` -username=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep account /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` -password=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn.tmp | grep password /tmp/vpn.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` +host=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn_con.tmp | grep server /tmp/vpn_con.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` +username=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn_con.tmp | grep account /tmp/vpn_con.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` +password=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn_con.tmp | grep password /tmp/vpn_con.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` # Checks to see if there is a current VPN connection and if it finds one it disconnects you. @@ -33,4 +33,4 @@ else rm /tmp/vpn.up fi -rm /tmp/vpn.tmp +rm /tmp/vpn_con.tmp From 29da152928dd47c187d8e5087ad5beb2023fe9e5 Mon Sep 17 00:00:00 2001 From: mike3 Date: Thu, 3 Jan 2013 13:09:16 -0500 Subject: [PATCH 37/40] modified: hack/vpn/vpn_chk.sh modified: hack/vpn/vpn_con.sh --- hack/vpn/vpn_chk.sh | 2 +- hack/vpn/vpn_con.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hack/vpn/vpn_chk.sh b/hack/vpn/vpn_chk.sh index 6732480..6258d19 100755 --- a/hack/vpn/vpn_chk.sh +++ b/hack/vpn/vpn_chk.sh @@ -1,7 +1,7 @@ #!/bin/sh # # Author: n3! - +# host=`sed -n '/vpn*/,/<\/vpn>/p' /data/.boxee/UserData/guisettings.xml > /tmp/vpn_chk.tmp | grep server /tmp/vpn_chk.tmp | awk -F'>' '{print $2}' | awk -F'<' '{print $1}'` diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index 47b350f..c0a3b9f 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -1,6 +1,7 @@ #!/bin/sh # # Author: n3! +# # Extracts VPN details from the guisettings.xml file and stores them into the following variables below. From 2da7adac2b84b04f635bf1b09ba83ff2681520cb Mon Sep 17 00:00:00 2001 From: mike3 Date: Thu, 3 Jan 2013 13:11:53 -0500 Subject: [PATCH 38/40] Small changes --- hack/vpn/vpn_con.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/vpn/vpn_con.sh b/hack/vpn/vpn_con.sh index c0a3b9f..c07c937 100755 --- a/hack/vpn/vpn_con.sh +++ b/hack/vpn/vpn_con.sh @@ -29,7 +29,7 @@ if [ "$status" = "" ]; then else dgw=`cat /data/hack/vpn/.gw` - killall pptp + killall pptp > /dev/null 2>&1 route add default gw $dgw rm /tmp/vpn.up From 7698fad88d3327665afafdc78ce3306cff24cc98 Mon Sep 17 00:00:00 2001 From: mike3 Date: Tue, 29 Jan 2013 10:24:31 -0500 Subject: [PATCH 39/40] modified: hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py --- hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py index b11c27f..ea9b84b 100644 --- a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py @@ -413,7 +413,4 @@ def check_new_version(): if command == "browser-homepage": set_browser_homepage() if command == "toggle-jump-to-last-unwatched": toggle_jump_to_last_unwatched() -<<<<<<< HEAD if command == "showvpn": showvpn_function() -======= ->>>>>>> upstream/development From 5bfc6db1993ce712a706c6e085b2f3b9e7edd51f Mon Sep 17 00:00:00 2001 From: mike3 Date: Mon, 11 Feb 2013 09:45:55 -0500 Subject: [PATCH 40/40] modified: hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py --- hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py index e0da559..62ae007 100644 --- a/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py +++ b/hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py @@ -416,9 +416,5 @@ def shutdown(): if command == "browser-homepage": set_browser_homepage() if command == "toggle-jump-to-last-unwatched": toggle_jump_to_last_unwatched() -<<<<<<< HEAD if command == "showvpn": showvpn_function() -======= - if command == "shutdown": shutdown() ->>>>>>> upstream/development