#!/bin/bash read -p "Warning: Only execute this script on a Raspberry Pi or cubietruck. The CCU2 executables won't work on other systems. The script also messes with your libraries, so make a backup before executing it! Do you want to continue? (y/n): " CONTINUE if [ "$CONTINUE" = "n" ]; then exit 0; fi mkdir /ccu2 wget -P /ccu2 http://www.eq-3.de/Downloads/Software/HM-CCU2-Firmware_Updates/HM-CCU2-2.9.12/HM-CCU-2.9.12.tar.gz [ $? -ne 0 ] && exit 1 tar -zxf /ccu2/HM-CCU-2.9.12.tar.gz -C /ccu2 [ $? -ne 0 ] && exit 1 rm -f /ccu2/HM-CCU-2.9.12.tar.gz echo "Downloading UBI Reader..." echo "(C) 2013 Jason Pruitt (Jason Pruitt), see https://github.com/jrspruitt/ubi_reader" wget -P /ccu2 https://github.com/jrspruitt/ubi_reader/archive/v2_ui.tar.gz [ $? -ne 0 ] && exit 1 tar -zxf /ccu2/v2_ui.tar.gz -C /ccu2 [ $? -ne 0 ] && exit 1 /ccu2/ubi_reader-2_ui/extract_files.py -o /ccu2/rootfs /ccu2/rootfs.ubi [ $? -ne 0 ] && exit 1 mv /ccu2/rootfs/rootfs.ubi/2054179022/root/* /ccu2 [ $? -ne 0 ] && exit 1 rm -f /ccu2/uImage rm -f /ccu2/rootfs.ubi rm -f /ccu2/EULA.de rm -f /ccu2/EULA.en rm -f /ccu2/v2_ui.tar.gz rm -f /ccu2/update_script apt-get update apt-get -y install lighttpd java7-runtime chmod 755 /ccu2/bin/* chmod 755 /ccu2/lib/* ln -s /ccu2/bin/ReGaHss /bin/ReGaHss ln -s /ccu2/bin/tclsh /bin/tclsh ln -s /ccu2/bin/hm_startup /bin/hm_startup ln -s /ccu2/bin/hm_autoconf /bin/hm_autoconf ln -s /ccu2/bin/hm_deldev /bin/hm_deldev ln -s /ccu2/bin/SetInterfaceClock /bin/SetInterfaceClock ln -s /ccu2/bin/crypttool /bin/crypttool ln -s /ccu2/bin/eq3configcmd /bin/eq3configcmd ln -s /ccu2/bin/eq3configd /bin/eq3configd mkdir /opt/HMServer ln -s /ccu2/opt/HMServer/HMServer.jar /opt/HMServer/HMServer.jar ln -s /ccu2/usr/local/etc/config/ /etc/config mkdir -p /etc/config/addons/www /etc/config/addons/mh ln -s /ccu2/opt/mh/user/ mh ln -s /ccu2/etc/config_templates/ /etc/config_templates ln -s /ccu2/etc/rega.conf /etc/rega.conf ln -s /ccu2/www /www echo " BidCos-RF xmlrpc_bin://127.0.0.1:2001 BidCos-RF " > /etc/config/InterfacesList.xml cp /ccu2/etc/config_templates/log4j.xml /etc/config echo "1DOM9142949672951033620337008101101Rooms314294967295101065535151151Functions314294967295103065535201201Favoriten314294967295105410101048576320210485763203104857632041048576365535301301Verknüpfungen3142949672951010065535401401Szenen31429496729510111100557765535501501Schaltungen3142949672951012065535700700AlarmMaps3142949672951022065535701701Alarms314294967295102106553500000001950950SYSVAR_PRESENCE108914294967295906553521007200120000110051005HM_AUTOCONF5771429496729500655350100700021140var x=system.Exec("/bin/hm_autoconf");655351006MapCondition41943050429496729530165535000100500000000110071007BidCos-RF4587531429496729510BidCos-RFxmlrpc_bin://127.0.0.1:20010110061006MapCondition41943050429496729530165535000100500004202202PC10485763142949672958060655350000203203PDA10485763142949672958060655350000204204Zentrale1048576314294967295806065535000010101010_USER10041048576314294967295106065535000061000100012904294967295100<desc/><mail/><pop3svr/><pop3port/><pop3name/><pop3pwd/><language/><favorite>65535</favorite><helpmode>0</helpmode><showlog>1</showlog><phone/><client>0</client><usr-sobj><count>0</count></usr-sobj><easylinkmode>0</easylinkmode><pwmd5/></user><oid>1001</oid><user><obj><id>1001</id><name/><type>129</type><enabled>0</enabled><accessrights>4294967295</accessrights><objflgs>1</objflgs><metadata><count>0</count></metadata></obj><userlevel>0</userlevel><password/><name/><firstname/><title/><desc/><mail/><pop3svr/><pop3port/><pop3name/><pop3pwd/><language/><favorite>65535</favorite><helpmode>0</helpmode><showlog>1</showlog><phone/><client>0</client><usr-sobj><count>0</count></usr-sobj><easylinkmode>0</easylinkmode><pwmd5/></user><oid>1002</oid><user><obj><id>1002</id><name/><type>129</type><enabled>0</enabled><accessrights>4294967295</accessrights><objflgs>1</objflgs><metadata><count>0</count></metadata></obj><userlevel>0</userlevel><password/><name/><firstname/><title/><desc/><mail/><pop3svr/><pop3port/><pop3name/><pop3pwd/><language/><favorite>65535</favorite><helpmode>0</helpmode><showlog>1</showlog><phone/><client>0</client><usr-sobj><count>0</count></usr-sobj><easylinkmode>0</easylinkmode><pwmd5/></user><oid>1003</oid><user><obj><id>1003</id><name/><type>129</type><enabled>0</enabled><accessrights>4294967295</accessrights><objflgs>1</objflgs><metadata><count>0</count></metadata></obj><userlevel>0</userlevel><password/><name/><firstname/><title/><desc/><mail/><pop3svr/><pop3port/><pop3name/><pop3pwd/><language/><favorite>65535</favorite><helpmode>0</helpmode><showlog>1</showlog><phone/><client>0</client><usr-sobj><count>0</count></usr-sobj><easylinkmode>0</easylinkmode><pwmd5/></user><oid>1004</oid><user><obj><id>1004</id><name>Admin</name><type>129</type><enabled>1</enabled><accessrights>4294967295</accessrights><objflgs>9</objflgs><metadata><count>0</count></metadata></obj><userlevel>8</userlevel><password/><name/><firstname/><title/><desc/><mail/><pop3svr/><pop3port/><pop3name/><pop3pwd/><language/><favorite>65535</favorite><helpmode>0</helpmode><showlog>1</showlog><phone/><client>3</client><usr-sobj><count>0</count></usr-sobj><easylinkmode>1</easylinkmode><pwmd5/></user><oid>1009</oid><user><obj><id>1009</id><name>RemoteApi</name><type>129</type><enabled>1</enabled><accessrights>4294967295</accessrights><objflgs>0</objflgs><metadata><count>0</count></metadata></obj><userlevel>0</userlevel><password/><name/><firstname/><title/><desc/><mail/><pop3svr/><pop3port/><pop3name/><pop3pwd/><language/><favorite>65535</favorite><helpmode>0</helpmode><showlog>1</showlog><phone/><client>0</client><usr-sobj><count>0</count></usr-sobj><easylinkmode>0</easylinkmode><pwmd5/></user></usermap><objmap><count>0</count></objmap></objmap><dom-gwcfg><gateway-config><obj><id>20</id><name>Gateway configuration</name><type>1</type><enabled>1</enabled><accessrights>4294967295</accessrights><objflgs>1</objflgs><metadata><count>0</count></metadata></obj><vendor-id>1</vendor-id><serial-number>12345678</serial-number><location>Demonstration board</location><register-url>http://www.fernzugriff.com/GatewayServices/Register.asmx</register-url><register-sa>www.fernzugriff.com/GatewayServices/</register-sa><register-ns>www.fernzugriff.com/GatewayServices/</register-ns><register-port>80</register-port><hwrev/><firmware-ver/><firmware-date/><guirev/><guest-level/><language/><cnfg-path>/etc/ReGaHss/homematic.regadom</cnfg-path><latitude/><longitude/><gmtoffset>60</gmtoffset></gateway-config></dom-gwcfg><dom-rtcfg><runtime-config><obj><id>21</id><name>Runtime configuration</name><type>1</type><enabled>1</enabled><accessrights>4294967295</accessrights><objflgs>1</objflgs><metadata><count>0</count></metadata></obj><error-mode>0</error-mode><cache-mode>1</cache-mode><upnp-enable>1</upnp-enable><knx-enable>0</knx-enable><knx-comm-port>/com/0</knx-comm-port><knx-comm-port-W32>COM1</knx-comm-port-W32><knx-ind-addr>4605</knx-ind-addr><ocn-enable>0</ocn-enable><ocn-comm-port>/com/0</ocn-comm-port><ocn-comm-port-W32>COM2</ocn-comm-port-W32><rf-enable>0</rf-enable><rf-comm-port>/com/0</rf-comm-port><rf-comm-port-W32>COM2</rf-comm-port-W32><ir-enable>0</ir-enable><ir-address/><bt-enable>0</bt-enable><bt-comm-port>/com/0</bt-comm-port><bt-comm-port-W32>COM2</bt-comm-port-W32><bt-baud-rate>49664</bt-baud-rate><service-listener>0</service-listener><ppp-type>0</ppp-type><xmlrpc-enable>1</xmlrpc-enable><xmlrpc-url>xmlrpc_bin://127.0.0.1:1999</xmlrpc-url><xmlifc-read>0</xmlifc-read><xmlrpc-ifile>/etc/config/InterfacesList.xml</xmlrpc-ifile><reg-enable>0</reg-enable><camfind-enable>0</camfind-enable><regacomm-enable>0</regacomm-enable><hist-cycle>0</hist-cycle><hist-filecycle>0</hist-filecycle><hist-filename/><hist-bufsize>3000</hist-bufsize><hist-changes>0</hist-changes><hist-email>0</hist-email><hist-mailuser>65535</hist-mailuser><hist-subject>History data</hist-subject><hist-alarm>65535</hist-alarm><chk-modified>1</chk-modified><chk-mod-cycle>300</chk-mod-cycle><savedom>1</savedom><savedom-cycle>43200</savedom-cycle><ueh-maxresp>120000</ueh-maxresp><ueh-minresp>5000</ueh-minresp><ueh-respdel>0</ueh-respdel></runtime-config></dom-rtcfg><dom-webcfg><web-config><obj><id>22</id><name>WEB configuration</name><type>1</type><enabled>1</enabled><accessrights>4294967295</accessrights><objflgs>1</objflgs><metadata><count>0</count></metadata></obj><style>ise</style><manuf-url>http://www.ise.de</manuf-url><manuf-image>img/ManufLogo.gif</manuf-image><server-url>http://www.fernzugriff.com/fernzugriff</server-url><server-image>img/ServerLogo.gif</server-image><title>ise Residential GatewayReGaRA Demoimg/MenuHome.gifimg/MenuGoBack.gif/login.htm/index.htm/pages/pages/tabs/admin/pages/tabs/user/pages/tabs/user/config/80:/config/65535/www/config/stringtable_de.txt33003/var/2Root514294967295103Root devices191429496729510011217655354Root channels35142949672951003133323332433655355Root data points6714294967295100814108939825740108941108925416126416110055779501089655356Root structure314294967295107810131513201330134013501370137003655357Root users1311429496729511PC100406100012910011291002129100312910041291009129655358Root user pages31429496729510230655359Root interfaces4587551429496729510322100745875310084587536553512Gateway17142949672952031323240065535113Gateway3314294967295200012214390655356553565535023StateVariables3314294967295102301200655356553565535024Communication33142949672951024012225260655352665535014Gateway-DP108914294967295201316100700001615Root Programs3142949672951025106553519Presence simulation3142949672951025206553531Messages objects314294967295103106553532Root UI data314294967295303306553527Root System Variables314294967295103424010894110896553528Root Service Messages314294967295103506553533Root Rules943718714294967295103606553534Root Calendars104857914294967295103706553516Root history data points6714294967295102406553535Root Conditions314294967295103806553536Root Single Conditions314294967295103906553537Root Destinations314294967295104006553538Root Single Destinations314294967295104106553539Gateway-IPDP82571429496729520132010070000040Gateway-SysAlDP108914294967295102MAX65000MIN06553516000700001641Gateway-SysSrvDP108914294967295102MAX65000MIN06553516000700001611Eventing11429496729510010ValueEventing11429496729510110051417SMTPServer5898251429496729510118POPClient209715314294967295103033620337" > /etc/config/homematic.regadom ln -s /ccu2/lib/ld-2.13.so /lib/ld-linux.so.3 ln -s /ccu2/lib/libpthread-2.13.so /lib/libpthread-2.13.so ln -s /lib/libpthread-2.13.so /lib/libpthread.so.0 ln -s /lib/arm-linux-gnueabihf/librt-2.13.so /lib/librt.so.1 ln -s /ccu2/lib/libXmlRpc.so /lib/libXmlRpc.so ln -s /ccu2/lib/libxmlparser.so /lib/libxmlparser.so ln -s /ccu2/lib/libelvutils.so /lib/libelvutils.so ln -s /ccu2/usr/lib/libstdc++.so.6.0.16 /lib/libstdc++.so.6.0.16 ln -s /lib/libstdc++.so.6.0.16 /lib/libstdc++.so.6 ln -s /ccu2/lib/libm-2.13.so /lib/libm-2.13.so ln -s /lib/libm-2.13.so /lib/libm.so.6 ln -s /ccu2/lib/libgcc_s.so.1 /lib/libgcc_s.so.1 ln -s /ccu2/lib/libc-2.13.so /lib/libc-2.13.so ln -s /lib/libc-2.13.so /lib/libc.so.6 ln -s /ccu2/lib/tclrega.so /lib/tclrega.so ln -s /ccu2/lib/tclrpc.so /lib/tclrpc.so ln -s /ccu2/lib/tclticks.so /lib/tclticks.so ln -s /ccu2/lib/tcl8.2/ /lib/tcl8.2 ln -s /ccu2/lib/libtcl8.2.so /lib/libtcl8.2.so ln -s /ccu2/lib/libdl-2.13.so /lib/libdl-2.13.so ln -s /lib/libdl-2.13.so /lib/libdl.so.2 rm -Rf /etc/lighttpd/conf.d ln -s /ccu2/etc/lighttpd/conf.d/ /etc/lighttpd/conf.d rm -f /etc/lighttpd/lighttpd.conf rm -f /etc/lighttpd/lighttpd_ssl.conf rm -f /etc/lighttpd/modules.conf ln -s /ccu2/etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf ln -s /ccu2/etc/lighttpd/lighttpd_ssl.conf /etc/lighttpd/lighttpd_ssl.conf ln -s /ccu2/etc/lighttpd/modules.conf /etc/lighttpd/modules.conf service lighttpd restart echo "#!/bin/sh ### BEGIN INIT INFO # Provides: ReGaHss # Required-Start: # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: # Short-Description: HomeMatic ReGaHss ### END INIT INFO set -e . /lib/lsb/init-functions start() { log_daemon_msg \"Starting ReGaHss\" \"ReGaHss\" || true if start-stop-daemon --start --quiet --oknodo --background -m --pidfile /var/run/ReGaHss.pid --exec /bin/ReGaHss -- -f /etc/rega.conf -l 1; then sleep 15 log_end_msg 0 || true else log_end_msg 1 || true fi } stop() { log_daemon_msg \"Stopping ReGaHss\" \"ReGaHss\" || true PID=\`cat /var/run/ReGaHss.pid\` if start-stop-daemon -K -q -p /var/run/ReGaHss.pid; then sleep 15 kill -9 \$PID > /dev/null 2>&1 log_end_msg 0 || true else log_end_msg 1 || true fi } restart() { stop sleep 5 start } case \"\$1\" in start) start ;; stop) stop ;; restart|reload) restart ;; *) echo \"Usage: \$0 {start|stop|restart}\" exit 1 esac exit \$? " > /etc/init.d/ReGaHss chmod 755 /etc/init.d/ReGaHss insserv ReGaHss service ReGaHss start echo "#!/bin/sh ### BEGIN INIT INFO # Provides: HMServer # Required-Start: ReGaHss # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: # Short-Description: HomeMatic Java Server ### END INIT INFO set -e . /lib/lsb/init-functions start() { log_daemon_msg \"Starting HMServer\" \"HMServer\" || true start-stop-daemon -S -q -p /var/run/HMServer.pid --exec /usr/bin/java -- -Xmx32m -Dlog4j.configuration=file:///etc/config/log4j.xml -Dfile.encoding=ISO-8859-1 -jar /opt/HMServer/HMServer.jar & sleep 120 log_end_msg 0 || true } stop() { log_daemon_msg \"Stopping HMServer\" \"HMServer\" || true PID=\`cat /var/run/HMServer.pid\` sleep 30 kill -9 \$PID > /dev/null 2>&1 log_end_msg 0 || true } restart() { stop sleep 5 start } case \"\$1\" in start) start ;; stop) stop ;; restart|reload) restart ;; *) echo \"Usage: \$0 {start|stop|restart}\" exit 1 esac exit \$? " > /etc/init.d/HMServer #chmod 755 /etc/init.d/HMServer #insserv HMServer #service HMServer start