From 8e8fe942b1002f44d348164d755c465b8798c5d1 Mon Sep 17 00:00:00 2001 From: HugoPoi Date: Sat, 20 Mar 2021 20:08:08 +0100 Subject: [PATCH] wip commit final script --- README.md | 1 - ...ot.sh => example_to_prepare_switch_root.sh | 0 install.hypercube | 55 +++++++++++++++++++ switch_root.sh | 3 +- 4 files changed, 57 insertions(+), 2 deletions(-) rename prepare_switch_root.sh => example_to_prepare_switch_root.sh (100%) create mode 100644 install.hypercube diff --git a/README.md b/README.md index e931e61..efe8253 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,5 @@ systemctl switch-root /tmp/tmproot/ `mount none /sys -t sysfs` `mount none /dev/pts -t devpts` -Fuck I need sshd `wget -O - https://github.com/YunoHost/arm-images/releases/download/v2020.10/internetcube_4.0.8_v2020.10_lime2.img.gz | gzip -cd | dd iflag=fullblock bs=1M oflag=direct status=progress of=/dev/mmcblk0` diff --git a/prepare_switch_root.sh b/example_to_prepare_switch_root.sh similarity index 100% rename from prepare_switch_root.sh rename to example_to_prepare_switch_root.sh diff --git a/install.hypercube b/install.hypercube new file mode 100644 index 0000000..b6ed68b --- /dev/null +++ b/install.hypercube @@ -0,0 +1,55 @@ +{ + "vpnclient": { + "server_name": "79.143.250.4", + "server_port": "1194", + "server_proto": "udp", + "ip6_net": "", + "ip4_addr": "", + "crt_server_ca": "-----BEGIN CERTIFICATE-----|MIIDJDCCAgygAwIBAgIJAOxs8j+RZXSTMA0GCSqGSIb3DQEBCwUAMBExDzANBgNV|BAMMBnZwbi1jYTAeFw0xNTA0MTEyMTA4NDVaFw0yNTA0MDgyMTA4NDVaMBExDzAN|BgNVBAMMBnZwbi1jYTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL0K|jACtTefp2L9aR+LBcxQiRtv5p3SAC1CQPmsB/hiaXvSU7VBuTC110Ag8e0nYA2OT|AAPTjX/3bPwdFQtdboBPS0leqSsyp0fF0cxnDKuJpv3UM8bq2mnpzi8MYUg70o0Y|ZHm+B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amxvwKBgQD2WdyMfla2rLt1jDkXtDxTCvHgeLQTHLzB|36Kdl3NWElwesd4+HTq9AhEAbsZ0IXh32MthC+/A0k9VvYNWaoXe0UK9vn5Io5HS|nw0EwOveaQqAtWfzUJw4GGYiYGdKH5/HLaH0DIO1dAAncmGM+mU5M6xKmEyTpZ/p|TxAsnb2Q3QKBgQD3PDPOAP5W9mkpWyQ/10EVidrv3WntbobW6FAWTGBiisPTzjIU|SCXtRGwO1GP8hCgZN248Eu6ITAW+HeL/mCUFPJ43Wt0JpstHkK3eOfpMc5sFPOH0|wFbmvP1fxtjLKdfFNsrmw2KyU3l8O4LPQmwxKDlJq8BIAg7QTSjP2fzK0QKBgQCi|qk9xDXMgiAn34jFIr6AtjUqNV+Y/wHf65DoyKPDlYpYlRnljNlW0vAqR6JNt1zP+|ns4cNI+JGNV93fc9NnVS3YZeV8x3FlqRYqhr/R9B6sYemqobBZ1BhQrbpCBP13Xf|RQhtZ14IkKIRaftz5Vq1XKNlVg8qZvCiU6xwaW/kmQKBgQDAO1T242rCOGbhdlPz|eiGJExSdRJ3Zimej6RTiZWf+NxWE4VepG2SZNBQ4gaVegjnJGqY538ulT+pqPanb|drwKoibh1l7d4Xh4ndCDD0PYlX4uY4QIBU0uG5/n8ZAYWEKXmCUxYyWP3dBJKyZU|7Ugd+ZpJ4fuMlVTcsX+x1Or4QQ==|-----END PRIVATE KEY-----|", + "crt_client_ta": "-----BEGIN OpenVPN Static key V1-----|c0988de3f54217855679aabc19c7c3fa|e1d96d56eca9a92e267cf5cea1359921|8b94f7972b49c0aa42b8736ce26dbcc8|69acbb8d877be06d6941ac4bd58b04c2|b7484b506575c3d512344c162ab4896f|81e6bd47d3bc3d4049d5e630b8e9405c|ee3767b685118881d58f0d6c53074608|dd3f8c178add12d2192bbc46617bed51|45af5c622f88f4e2a91901bed4ecdd36|fc1a7f3365680c66cec4ff30edd6a1df|b83fcf704ea937e42393a7594c08ea4d|a5526f7711e551dd754b4fc28b43d20e|dcdaaa7f05091f880106c64d706309ab|6d8b345b8e89dd0084e1918290f801a8|dbdec0a01002371994dbe9d18ae9330c|a676d52f58cac3cca66bb7693a111c85|-----END OpenVPN Static key V1-----|", + "login_user": "", + "login_passphrase": "", + "dns0": "79.143.250.1", + "dns1": "80.67.169.40", + "openvpn_rm": [ + "tun-ipv6", + "pull", + "nobind", + "comp-lzo adaptive", + "ns-cert-type server", + "route-ipv6 2000::/3", + "redirect-gateway def1 bypass-dhcp", + "tls-client" + ], + "openvpn_add": [ + "client", + "dev tun", + "compress lzo" + ] + }, + "hotspot": { + "wifi_ssid": "Test Reseau 5G Covid Linky v2", + "wifi_passphrase": "gV-vJhNZjQox4IuvT1Nu", + "ip6_net": "", + "ip6_dns0": "2001:913::8", + "ip6_dns1": "2001:910:800::40", + "ip4_dns0": "80.67.188.188", + "ip4_dns1": "80.67.169.12", + "ip4_nat_prefix": "10.0.242", + "firmware_nonfree": "no" + }, + "yunohost": { + "domain": "testlime2.local", + "password": "#pvZdnmM5QYAhMVik2", + "user": "hugo", + "user_firstname": "Hugo", + "user_lastname": "Hugo", + "user_password": "#pvZdnmM5QYAhMVik2" + }, + "unix": { + "root_password": "#pvZdnmM5QYAhMVik2", + "lang": "fr" + } +} \ No newline at end of file diff --git a/switch_root.sh b/switch_root.sh index 286f1cd..41d7beb 100755 --- a/switch_root.sh +++ b/switch_root.sh @@ -17,4 +17,5 @@ sudo swapoff -a sudo mkdir -p /sysroot sudo mount --rbind /tmp/sys /sysroot sudo touch /etc/initrd-release - +# it will stop all other services (isolate) and call systemctl switch-root /sysroot +sudo systemctl --no-block isolate initrd-switch-root