Guest User

Untitled

a guest
Apr 16th, 2018
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. #!/bin/sh
  2. # configuration script for wrt54g
  3.  
  4. # vim: set foldmethod=marker et :
  5.  
  6. . ./passwords
  7.  
  8. # {{{ system
  9. uci set system.@system[0].hostname='wrt54g'
  10. uci set system.@system[0].timezone='CET-1CEST,M3.5.0,M10.5.0/3'
  11. # }}}
  12.  
  13. # {{{ profile
  14. cp profile /etc/profile
  15. # }}}
  16.  
  17. # {{{ dropbear
  18. uci set dropbear.@dropbear[0].PasswordAuth='off'
  19. cp christoph@thinkpad.pub /etc/dropbear/authorized_keys
  20. rm -f /etc/banner
  21. # }}}
  22.  
  23. # {{{ network
  24. uci set network.lan.ipaddr='10.0.0.1'
  25. uci set network.lan.ip6addr='2001:6f8:11c0:0:21e:e5ff:fe46:798/64'
  26.  
  27. uci set network.wan.proto='pppoe'
  28. uci set network.wan.username='04216842013'
  29. uci set network.wan.password="$PASSWORD_PPP"
  30.  
  31. uci set wireless.wl0.disabled=0
  32. uci set wireless.@wifi-iface[0].ssid='betelgeuse'
  33. uci set wireless.@wifi-iface[0].encryption='psk+psk2'
  34. uci set wireless.@wifi-iface[0].key="$PASSWORD_WIRELESS"
  35. # }}}
  36.  
  37. # {{{ hosts
  38. cp hosts /etc/hosts
  39. # }}}
  40.  
  41. # {{{ aiccu
  42. uci set aiccu.@aiccu[0].username='CPX1-SIXXS'
  43. uci set aiccu.@aiccu[0].password="$PASSWORD_SIXXS"
  44. uci set aiccu.@aiccu[0].protocol='tic'
  45. uci set aiccu.@aiccu[0].interface='sixxs'
  46. uci set aiccu.@aiccu[0].tunnel_id='T14974'
  47. uci set aiccu.@aiccu[0].defaultroute=1
  48. uci set aiccu.@aiccu[0].nat=1
  49. uci set aiccu.@aiccu[0].heartbeat=1
  50.  
  51. cat > /etc/ppp/ip-up.d/aiccu <<EOF
  52. #!/bin/sh
  53. /etc/init.d/aiccu restart
  54. EOF
  55. chmod +x /etc/ppp/ip-up.d/aiccu
  56. # }}}
  57.  
  58. # {{{ radvd
  59. uci set radvd.@interface[0].ignore=0
  60. uci set radvd.@prefix[0].interface='lan'
  61. uci set radvd.@prefix[0].prefix='2001:6f8:11c0:0::/64'
  62. uci set radvd.@prefix[0].AdvOnLink=1
  63. uci set radvd.@prefix[0].AdvAutonomous=1
  64. uci set radvd.@prefix[0].AdvRouterAddr=1
  65. uci set radvd.@prefix[0].ignore=0
  66. # }}}
  67.  
  68. # {{{ enable ipv6 forwarding
  69. sed -i -e 's/# \(net.ipv6.conf.all.forwarding=1\)/\1/' /etc/sysctl.conf
  70. sysctl -p >/dev/null
  71. # }}}
  72.  
  73. # {{{ qos
  74. uci set qos.wan.enabled=1
  75. uci set qos.wan.upload=1024
  76. uci set qos.wan.download=16000
  77. # }}}
  78.  
  79. # {{{ firewall
  80. cp firewall.user /etc/firewall.user
  81. # }}}
  82.  
  83. # {{{ dynamic dns
  84. cp dynamicdns/dynamicdns-script /etc/ppp/ip-up.d/dynamicdns
  85. cp dynamicdns/orion-privkey /etc/ppp/ip-up.d/
  86. cp dynamicdns/orion-fingerprint /etc/ppp/ip-up.d/
  87. # }}}
  88.  
  89. # {{{ cron auto-reconnect
  90. cat > /etc/crontabs/root <<EOF
  91. 0 3 * * * touch /tmp/ppp-not-disconnected
  92. 0 4 * * * test -e /tmp/ppp-not-disconnected && ifup wan
  93. EOF
  94. cat > /etc/ppp/ip-up.d/rm-ppp-not-disconnected <<EOF
  95. #!/bin/sh
  96. rm -f /tmp/ppp-not-disconnected
  97. EOF
  98. chmod +x /etc/ppp/ip-up.d/rm-ppp-not-disconnected
  99. /etc/init.d/cron enable
  100. /etc/init.d/cron start
  101. # }}}
  102.  
  103. # {{{ commit uci settings
  104. uci commit
  105. # }}}
Add Comment
Please, Sign In to add comment