Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main python script break a line in bt_daemon-apps.sh script #25

Closed
Balakao opened this issue Dec 4, 2023 · 0 comments
Closed

main python script break a line in bt_daemon-apps.sh script #25

Balakao opened this issue Dec 4, 2023 · 0 comments

Comments

@Balakao
Copy link

Balakao commented Dec 4, 2023

Hi,

This part didn't work for me :

        """Add host and IP."""
        line1 = f'/bin/bt_hosts.sh add {host} {ip}'
        with open(f'{self.mntLoc}/etc/init.d/bt_daemon-apps.sh', 'r') as f:
            contents = f.readlines()
        for i, line in enumerate(contents):
            if 'openserver' in line:
                contents.insert(i + 1, f'\t{line1}\n')
                break
        with open(f'{self.mntLoc}/etc/init.d/bt_daemon-apps.sh', 'w') as f:
            contents = ''.join(contents)
            f.write(contents)
        print('Editing "/etc/init.d/bt_daemon-apps.sh" done '
              f'for host {host}:{ip} ✅')

The add part on the script did that on the start function :

        export LD_LIBRARY_PATH=${USER_LIBDIR}:/home/bticino/lib:/home/bticino/libcoso
        /bin/bt_hosts.sh add localhost 127.0.0.1
        /bin/bt_hosts.sh add openserver 127.0.0.1
        /bin/bt_hosts.sh add
 192.168.0.135
        cd /home/bticino
        bin/bt_daemon &
}

No host added, a break line, and a black screen at reboot on Classe 300 (I was scared, trust me T_T). I tried to connect to SSH, that worked, and found reason of malfunction (I removed the bt_hosts.sh line added, dont need it to work with mqtt).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants