From 5e46d14d133c5b18ab21c791ace86b9201e2d6fb Mon Sep 17 00:00:00 2001 From: Roel Date: Wed, 28 May 2014 23:01:03 +0200 Subject: [PATCH] meshenger now changes the working directory to /meshenger/, fixed the lazyinstall --- lazyinstall/lazyinstall2.sh | 2 +- main.py | 5 ++++- meshenger_clientserve.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lazyinstall/lazyinstall2.sh b/lazyinstall/lazyinstall2.sh index 14372e0..1ccda10 100755 --- a/lazyinstall/lazyinstall2.sh +++ b/lazyinstall/lazyinstall2.sh @@ -16,7 +16,7 @@ head -n 10 /etc/config/wireless >> tmp_wireless cat wireless >> tmp_wireless mv tmp_wireless /etc/config/wireless -cat firewall >> /etc/config/firewall +cat firewall >>ls /etc/config/firewall mv dhcp /etc/config/dhcp diff --git a/main.py b/main.py index 5a8e984..66ae3fa 100755 --- a/main.py +++ b/main.py @@ -15,6 +15,9 @@ class Meshenger: os.system("echo 1 >> /proc/sys/net/ipv6/conf/br-lan/disable_ipv6") os.system("echo 1 >> /proc/sys/net/ipv6/conf/br-hotspot/disable_ipv6") + + os.chdir(os.path.dirname(__file__)) # change present working directory to the one where this file is + self.own_ip = self.get_ip_adress().strip() if not os.path.exists(self.msg_dir): @@ -234,7 +237,7 @@ Hack to adhoc0's inet6 adress """ if not os.path.isfile('interfaceip6adress'): os.system('ifconfig -a adhoc0 | grep inet6 > /root/meshenger/interfaceip6adress') - with open('interfaceip6adress', 'r') as a: + with open('/root/meshenger/interfaceip6adress', 'r') as a: return a.read().split()[2].split('/')[0] diff --git a/meshenger_clientserve.py b/meshenger_clientserve.py index eb45d73..bf0da87 100644 --- a/meshenger_clientserve.py +++ b/meshenger_clientserve.py @@ -24,7 +24,7 @@ class ClientServeHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): self.send_header('Content-type', 'text/html') self.end_headers() - f = os.path.join( "webapp.html") + f = os.path.join('/home/root/meshenger/',"webapp.html") with open( f, 'r') as the_file: self.wfile.write(the_file.read())