2019-12-19 10:34:19 +00:00
|
|
|
"""Onionr - Private P2P Communication.
|
|
|
|
|
|
|
|
Command to make new network-wide MOTD message. Only network admin can do this
|
|
|
|
The key is set in onionrvalues
|
|
|
|
"""
|
2019-10-08 02:32:33 +00:00
|
|
|
import onionrblocks
|
2019-12-19 10:34:19 +00:00
|
|
|
"""
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
"""
|
|
|
|
|
2019-10-08 02:32:33 +00:00
|
|
|
|
|
|
|
def motd_creator():
|
2019-12-19 10:34:19 +00:00
|
|
|
"""Create a new MOTD message for the Onionr network."""
|
2019-10-08 02:32:33 +00:00
|
|
|
motd = ''
|
|
|
|
new = ''
|
|
|
|
print('Enter a new MOTD, quit on a new line:')
|
|
|
|
while new != 'quit':
|
2019-12-19 10:34:19 +00:00
|
|
|
new = input() # nosec B323
|
2019-10-08 02:32:33 +00:00
|
|
|
if new != 'quit':
|
|
|
|
motd += new
|
|
|
|
bl = onionrblocks.insert(motd, header='motd', sign=True)
|
|
|
|
print(f"inserted in {bl}")
|
|
|
|
|
2019-12-19 10:34:19 +00:00
|
|
|
|
|
|
|
motd_creator.onionr_help = "Create a new MOTD for the network" # type: ignore
|