diff --git a/install.py b/install.py index 250f7f5..3ef02b1 100755 --- a/install.py +++ b/install.py @@ -183,7 +183,7 @@ def write_when_new(filename, content, ignore_reduction=False): print('>>>') print('\n'.join(old[-bottom_lines:-1])) print("===") - return True + return content def create_if(name, cfg, mac, dhcp_server_cfg): @@ -447,7 +447,13 @@ def handle_config(): if action == 'restart': unix_cmd('systemctl restart %s' % service) unix_cmd('systemctl enable %s' % service) - return True + result = [f'config file:\n {cfgfile}'] + for section in parser.sections(): + result.append(section) + for key, value in parser.items(section): + result.append(f' {key} = {value}') + result.append('') + return '\n'.join(result) doit = False @@ -465,5 +471,7 @@ elif show.dirty and more_info == 'NONE': if answer.lower().startswith('y'): handle_config() walk(Do()) + with open('/root/aputools/current', 'w') as f: + f.write(result) else: print('nothing to do') diff --git a/servercfg/linseapu6_5fa5cc.cfg b/servercfg/linseapu6_5fa5cc.cfg new file mode 100644 index 0000000..2a55d7f --- /dev/null +++ b/servercfg/linseapu6_5fa5cc.cfg @@ -0,0 +1,11 @@ +[NETWORK] +; please refer to README.md for help +enp1s0=192.168.127.254 +enp2s0=192.168.12.2 +enp3s0=192.168.13.3 +enp4s0=wan,192.168.1.0/24 + +[ROUTER] +; please refer to README.md for help +3001=192.168.127.254:3001 +8080=192.168.127.254:80 diff --git a/to_system/etc/profile.d/welcome.sh b/to_system/etc/profile.d/welcome.sh index 421c75c..6d5eaf3 100755 --- a/to_system/etc/profile.d/welcome.sh +++ b/to_system/etc/profile.d/welcome.sh @@ -6,4 +6,6 @@ function service_status () { echo ${name} $(systemctl is-active ${name}) $(systemctl is-enabled ${name}); \ done | column -t | grep --color=always '\(disabled\|inactive\|$\)' } +alias current='cat /root/aputools/current' service_status router frappy +echo "> current # show currently installed state"