Advertisement
Guest User

Untitled

a guest
Jun 25th, 2012
797
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.36 KB | None | 0 0
  1. #!/bin/sh
  2. # Original script by Jebba, modified by 9000 @ talk.maemo.org
  3. # Run this script to share your Internet connection.
  4. # Activate your gprs0 (fone data) connection with the GUI
  5.  
  6. #run-standalone.sh dbus-send --system --type=method_call --dest=com.nokia.icd_ui /com/nokia/icd_ui com.nokia.icd_ui.show_conn_dlg boolean:false
  7.  
  8. IP_ADDR="192.168.1.1"
  9. NETMASK="255.255.255.0"
  10. DHCP_RANGE="192.168.1.100,192.168.1.127"
  11. RUNFILE="/var/run/wifi_tethering.pid"
  12. DNSMASQ="/usr/sbin/dnsmasq"
  13. ESSID="honeypot"
  14. PASSWORD="0000000000000"
  15. CHANNEL="10"
  16. HOSTIDEV="gprs0"
  17.  
  18. set -x
  19.  
  20. start wlancond
  21.  
  22. # Load modules
  23. modprobe crc7
  24. modprobe mac80211
  25. modprobe wl12xx
  26. modprobe ipt_MASQUERADE
  27.  
  28. # flush old rules
  29. iptables -F
  30. iptables -t nat -F
  31.  
  32. iptables -t nat -A POSTROUTING -o $HOSTIDEV -j MASQUERADE
  33.  
  34. # forward IPs
  35. echo 1 > /proc/sys/net/ipv4/ip_forward
  36.  
  37. ifconfig wlan0 down
  38. iwconfig wlan0 mode ad-hoc
  39. ifconfig wlan0 up
  40. iwconfig wlan0 essid $ESSID
  41. iwconfig wlan0 key s:$PASSWORD
  42. iwconfig wlan0 channel $CHANNEL
  43. ifconfig wlan0 $IP_ADDR netmask $NETMASK up
  44.  
  45. # Setup DNS and DHCP
  46. start-stop-daemon -S -p $RUNFILE -m -b -x $DNSMASQ -- -k -I lo -z -a $IP_ADDR -F $DHCP_RANGE -b
  47.  
  48. run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:'WiFi HotSpot Activated'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement