Script to migrate a standard Debian install to Devuan.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

570 lines
17 KiB

  1. #!/bin/sh
  2. #############################################################
  3. # Debian to Devuan Migrator v.1.9-alfa for desktops #
  4. # #
  5. # farmatito (c) 2021 <farmatito@tiscali.it> GPLv2 #
  6. # Script to migrate a standard debian install to devuan #
  7. # Supported OS versions: #
  8. # a) Debian buster to Devuan beowulf #
  9. # b) Debian bullseye to Devuan chimaera #
  10. # #
  11. # Supported DE's: #
  12. # 1) GNOME #
  13. # 2) LXDE #
  14. # 3) LXQT #
  15. # 4) XFCE #
  16. # 5) KDE #
  17. # 6) MATE #
  18. # 7) CINNAMON #
  19. #############################################################
  20. FOUND_DE=0
  21. GNOME=0
  22. GNOME_FLASHBACK=0
  23. LXDE=0
  24. LXQT=0
  25. XFCE=0
  26. KDE=0
  27. MATE=0
  28. CINNAMON=0
  29. NETWORK=0
  30. INSTALL_DBUS=0
  31. INSTALL_NM=0
  32. INSTALL_NM_GNOME=0
  33. _CONTRIB=""
  34. _NONFREE=""
  35. . /etc/os-release
  36. # Prepare for next Debian release and detect version
  37. if test "x$VERSION_ID" = "x10" ; then
  38. echo "Detected: Debian $VERSION"
  39. DEVUAN_CODENAME="beowulf"
  40. LIBPLYMOUTH="libplymouth4"
  41. IIO_SENSORS_PROXY="iio-sensor-proxy"
  42. SYSTEMD_TIMESYNCD=""
  43. INSTALL_DEBIAN_PULSEAUDIO_CONFIG_OVERRIDE=1
  44. INSTALL_GNOME_SCREENSAVER=0
  45. PAD=" "
  46. else
  47. if test "x$VERSION_ID" = "x11" ; then
  48. echo "Detected: Debian $VERSION"
  49. DEVUAN_CODENAME="chimaera"
  50. LIBPLYMOUTH="libplymouth5"
  51. IIO_SENSORS_PROXY=""
  52. SYSTEMD_TIMESYNCD="systemd-timesyncd"
  53. INSTALL_DEBIAN_PULSEAUDIO_CONFIG_OVERRIDE=0
  54. PAD=""
  55. fi
  56. fi
  57. # PROGRAMS NEEDED
  58. # TODO test if all needed programs are there (Paranoia)
  59. # CURRENT DEVUAN KEYRING PACKAGE
  60. DEVUAN_KEYRING="devuan-keyring_2017.10.03_all.deb"
  61. # SET PATH
  62. export PATH=$PATH:/usr/sbin:/sbin
  63. # CHECK FOR ROOT
  64. ID=$(id -u)
  65. if test $ID -ne 0 ; then
  66. echo "You need root permissions to run this script. Exiting..."
  67. exit 1
  68. fi
  69. # TEST NETWORK AS MIGRATION WILL FAIL IF NOT ONLINE
  70. NETWORK=$(printf "GET /nm HTTP/1.1\\r\\nHost: network-test.debian.org\\r\\n\\r\\n" | nc -w1 network-test.debian.org 80 | grep -c "NetworkManager is online")
  71. if test $NETWORK -ne 1 ; then
  72. NETWORK=$(printf "GET /ncsi.txt HTTP/1.1\\r\\nHost: www.msftncsi.com\\r\\n\\r\\n" | nc -w1 www.msftncsi.com 80 | grep -c "Microsoft NCSI")
  73. if test $NETWORK -ne 1 ; then
  74. echo "Your network seems to be down. "
  75. echo "Cannot connect to the Internet. Exiting..."
  76. exit 1
  77. fi
  78. fi
  79. #echo "Network Connectivity Status: OK"
  80. # DISCLAIMER #
  81. echo "Warning use at your own risk. BACKUP YOUR DATA FIRST!!!"
  82. echo "Are you sure? [y|n]"
  83. read -r ANS
  84. if test "x$ANS" != "xy" -a "x$ANS" != "xY"; then
  85. exit 0
  86. fi
  87. # ntpdate is deprecated in debian but still exists in
  88. # bullseye repos so we still use it here.
  89. # In the future we will need to switch to
  90. # ntpsec-ntpdate or sntp -S pool.ntp.org
  91. # this is less ideal as they have more dependencies.
  92. # INSTALL NTPDATE IF NEEDED
  93. NTPDATE=$(which ntpdate-debian)
  94. if test -x "$NTPDATE" ; then
  95. echo "ntpdate-debian is already installed...good"
  96. # Wrong date and time is one of the causes of failure of apt update
  97. # and subsequent devuan deb packages download which breaks
  98. # the migration process, so we ensure that date and time are set correctly
  99. else
  100. echo "Installing ntpdate-debian"
  101. apt install ntpdate > /dev/null 2>&1
  102. fi
  103. echo "Setting date and time with ntpdate-debian"
  104. ntpdate-debian pool.ntp.org
  105. # INSTALL WGET IF NEEDED
  106. WGET=$(which wget)
  107. if test -x "$WGET" ; then
  108. echo "wget is already installed...good"
  109. else
  110. echo "Installing wget"
  111. apt install wget > /dev/null 2>&1
  112. fi
  113. # DOWNLOAD DEVUAN KEYRING AND IMPLICIT TEST FOR NETWORK
  114. echo "Downloading Devuan Keyring: $DEVUAN_KEYRING"
  115. wget http://deb.devuan.org/devuan/pool/main/d/devuan-keyring/"$DEVUAN_KEYRING" > /dev/null 2>&1
  116. if test $? -ne 0 ; then
  117. echo "Could not download Devuan Keyring: $DEVUAN_KEYRING"
  118. echo "Exiting..."
  119. exit 1
  120. fi
  121. # DETECT INSTALLED DESKTOP ENVIRONMENTS
  122. dpkg -L task-gnome-desktop > /dev/null 2>&1
  123. if test $? -eq 0 ; then
  124. echo "Detected GNOME DE"
  125. GNOME=1
  126. FOUND_DE=1
  127. INSTALL_DBUS=1
  128. INSTALL_NM=1
  129. INSTALL_NM_GNOME=1
  130. if test "x$VERSION_ID" = "x11" ; then
  131. INSTALL_GNOME_SCREENSAVER=1
  132. fi
  133. # USES GDM3 but is problematic install slim instead
  134. fi
  135. dpkg -L task-gnome-flashback-desktop > /dev/null 2>&1
  136. if test $? -eq 0 ; then
  137. echo "Detected GNOME FLASHBACK DE"
  138. GNOME_FLASHBACK=1
  139. FOUND_DE=1
  140. INSTALL_DBUS=1
  141. INSTALL_NM=1
  142. INSTALL_NM_GNOME=1
  143. INSTALL_GNOME_SCREENSAVER=1
  144. # USES GDM3 but is problematic install slim instead
  145. fi
  146. dpkg -L task-lxde-desktop > /dev/null 2>&1
  147. if test $? -eq 0 ; then
  148. echo "Detected LXDE DE"
  149. LXDE=1
  150. FOUND_DE=1
  151. INSTALL_DBUS=1
  152. # USES CONNMAN in debian 11
  153. # USES WICD in debian 10
  154. fi
  155. dpkg -L task-lxqt-desktop > /dev/null 2>&1
  156. if test $? -eq 0 ; then
  157. echo "Detected LXQT DE"
  158. LXQT=1
  159. FOUND_DE=1
  160. INSTALL_DBUS=1
  161. # USES CONNMAN in debian 11 and debian 10
  162. # USES SDDM but is problematic install slim instead
  163. fi
  164. dpkg -L task-xfce-desktop > /dev/null 2>&1
  165. if test $? -eq 0 ; then
  166. echo "Detected XFCE DE"
  167. XFCE=1
  168. FOUND_DE=1
  169. INSTALL_DBUS=1
  170. INSTALL_NM=1
  171. INSTALL_NM_GNOME=1
  172. fi
  173. dpkg -L task-kde-desktop > /dev/null 2>&1
  174. if test $? -eq 0 ; then
  175. echo "Detected KDE DE"
  176. KDE=1
  177. FOUND_DE=1
  178. INSTALL_DBUS=1
  179. # USES SDDM but is problematic install slim instead
  180. fi
  181. dpkg -L task-mate-desktop > /dev/null 2>&1
  182. if test $? -eq 0 ; then
  183. echo "Detected MATE DE"
  184. MATE=1
  185. FOUND_DE=1
  186. INSTALL_DBUS=1
  187. fi
  188. dpkg -L task-cinnamon-desktop > /dev/null 2>&1
  189. if test $? -eq 0 ; then
  190. echo "Detected CINNAMON DE"
  191. CINNAMON=1
  192. FOUND_DE=1
  193. INSTALL_DBUS=1
  194. fi
  195. if test $FOUND_DE -eq 0 ; then
  196. echo "No supported Desktop Environment detected!"
  197. #echo "Is this a server?"
  198. echo "If you are logged in remotely with SSH be aware"
  199. echo "that the network might not work on reboot!"
  200. echo "Are you sure you want to continue? [y|n]"
  201. read -r ANS
  202. if test "x$ANS" != "xy" -a "x$ANS" != "xY"; then
  203. exit 0
  204. fi
  205. fi
  206. # RESTORE OLD SU BEHAVIOUR - no keep as before
  207. #echo "ALWAYS_SET_PATH yes" > /etc/default/su
  208. echo "Do you want contrib repos to be included in your apt sources? [y|n]"
  209. read -r ANS
  210. if test "x$ANS" = "xy" -o "x$ANS" = "xY"; then
  211. _CONTRIB=" contrib"
  212. fi
  213. echo "Do you want non-free repos to be included in your apt sources? [y|n]"
  214. read -r ANS
  215. if test "x$ANS" = "xy" -o "x$ANS" = "xY"; then
  216. _NONFREE=" non-free"
  217. fi
  218. # ADD DEVUAN REPOS
  219. # TODO use mktemp /etc/apt/sources.list.d/XXXXXXXXX here and
  220. # only add to sources.list if migration is successful?
  221. # Cleanup in case of failure would be easier this way.
  222. # TODO add also deb-src repos?
  223. { echo ""; \
  224. echo "deb http://deb.devuan.org/merged $DEVUAN_CODENAME main$_CONTRIB$_NONFREE"; \
  225. echo "deb http://deb.devuan.org/merged $DEVUAN_CODENAME-updates main$_CONTRIB$_NONFREE"; \
  226. echo "deb http://deb.devuan.org/merged $DEVUAN_CODENAME-security main$_CONTRIB$_NONFREE"; } >> /etc/apt/sources.list
  227. # PIN PREFERENCE FOR DEVUAN PACKGES
  228. # TODO use mktemp /etc/apt/preferences.d/XXXXXXXXX ?
  229. { echo "Package: *"; \
  230. echo "Pin: origin \"deb.devuan.org\""; \
  231. echo "Pin-Priority: 900"; } > /etc/apt/preferences.d/"$DEVUAN_CODENAME"
  232. # STOP THE TIMERS FOR APT TO AVOID INTERFERENCES (FILE LOCKS)
  233. systemctl stop apt-daily.timer
  234. systemctl stop apt-daily-upgrade.timer
  235. # INSTALL DEVUAN KEYRING
  236. echo "Installing $DEVUAN_KEYRING"
  237. dpkg -i "$DEVUAN_KEYRING" > /dev/null 2>&1
  238. rm -f "$DEVUAN_KEYRING"
  239. # UPDATE
  240. echo "Update repos"
  241. apt update > /dev/null 2>&1
  242. # INSTALL DEVUAN PACKAGES TO INIT MIGRATION
  243. if test $GNOME -eq 1 ; then
  244. echo "* Select slim as Display manager when prompted! *"
  245. echo "* Hit Enter to continue *"
  246. read -r DUMMY
  247. echo "Installing task-gnome-desktop"
  248. apt install task-gnome-desktop --no-install-recommends -y > /dev/null 2>&1
  249. echo "Installing slim DM"
  250. apt install slim -yq
  251. # gnome-screensaver is needed because in bullseye screen locking
  252. # is builtin in gdm3
  253. if test $INSTALL_GNOME_SCREENSAVER -eq 1 ; then
  254. echo "Installing gnome-screensaver"
  255. apt install gnome-screensaver -y > /dev/null 2>&1
  256. # add autostart entry for gnome-screensaver
  257. ln -s /usr/share/applications/gnome-screensaver.desktop /etc/xdg/autostart/gnome-screensaver.desktop
  258. fi
  259. # DISABLE GDM3 TO AVOID BLACK SCREEN AT REBOOT - PARANOIA
  260. systemctl disable gdm3
  261. fi
  262. if test $GNOME_FLASHBACK -eq 1 ; then
  263. echo "* Select slim as Display manager when prompted! *"
  264. echo "* Hit Enter to continue *"
  265. read -r DUMMY
  266. echo "Installing task-gnome-desktop"
  267. apt install task-gnome-desktop --no-install-recommends -y > /dev/null 2>&1
  268. echo "Installing slim DM"
  269. apt install slim -yq
  270. # gnome-screensaver is needed because in bullseye screen locking
  271. # is builtin in gdm3
  272. if test $INSTALL_GNOME_SCREENSAVER -eq 1 ; then
  273. echo "Installing gnome-screensaver"
  274. apt install gnome-screensaver -y > /dev/null 2>&1
  275. # add autostart entry for gnome-screensaver
  276. ln -s /usr/share/applications/gnome-screensaver.desktop /etc/xdg/autostart/gnome-screensaver.desktop
  277. fi
  278. # DISABLE GDM3 TO AVOID BLACK SCREEN AT REBOOT - PARANOIA
  279. systemctl disable gdm3
  280. fi
  281. if test $LXDE -eq 1 ; then
  282. echo "Install task-lxde-desktop"
  283. apt install task-lxde-desktop -y > /dev/null 2>&1
  284. # uses wicd in debian 10 and connman in debian 11
  285. fi
  286. if test $LXQT -eq 1 ; then
  287. echo "Installing task-lxqt-desktop"
  288. apt install task-lxqt-desktop --no-install-recommends -y > /dev/null 2>&1
  289. echo "* Select slim as Display manager when prompted! *"
  290. echo "* Hit Enter to continue *"
  291. read -r DUMMY
  292. echo "Installing slim DM"
  293. apt install slim -yq
  294. # PARANOIA
  295. systemctl disable sddm
  296. fi
  297. if test $XFCE -eq 1 ; then
  298. # Don't install recommends for task-xfce-desktop as it sucks in wicd but
  299. # migrating user is used to network-manager and this will spoil his experience.
  300. apt install task-xfce-desktop --no-install-recommends -y
  301. fi
  302. if test $KDE -eq 1 ; then
  303. echo "* Select slim as Display manager when prompted! *"
  304. echo "* Hit Enter to continue *"
  305. read -r DUMMY
  306. apt install task-kde-desktop --no-install-recommends -y > /dev/null 2>&1
  307. apt install slim -y
  308. # PARANOIA
  309. systemctl disable sddm
  310. #systemctl disable slim
  311. fi
  312. if test $MATE -eq 1 ; then
  313. # Don't install recommends for task-mate-desktop as it sucks in wicd but
  314. # migrating user is used to network-manager and this will spoil his experience.
  315. apt install task-mate-desktop --no-install-recommends -y
  316. fi
  317. if test $CINNAMON -eq 1 ; then
  318. apt install task-cinnamon-desktop -y
  319. fi
  320. # DOWNLOAD PACKAGES FOR LATER USE
  321. DOWNLOAD_LIST="\
  322. util-linux \
  323. libelogind0 \
  324. libpam-elogind \
  325. elogind \
  326. init \
  327. sysvinit-core \
  328. initscripts \
  329. sysv-rc \
  330. insserv \
  331. startpar \
  332. eudev \
  333. libeudev1"
  334. if test $INSTALL_DBUS -eq 1 ; then
  335. DOWNLOAD_LIST="$DOWNLOAD_LIST dbus dbus-x11 libdbus-1-3"
  336. fi
  337. if test $INSTALL_NM -eq 1 ; then
  338. DOWNLOAD_LIST="$DOWNLOAD_LIST network-manager libnm0"
  339. fi
  340. if test $INSTALL_NM_GNOME -eq 1 ; then
  341. DOWNLOAD_LIST="$DOWNLOAD_LIST network-manager-gnome"
  342. fi
  343. if test $INSTALL_DEBIAN_PULSEAUDIO_CONFIG_OVERRIDE -eq 1 ; then
  344. DOWNLOAD_LIST="$DOWNLOAD_LIST debian-pulseaudio-config-override"
  345. fi
  346. for DEB in $DOWNLOAD_LIST
  347. do
  348. echo -n "Downloading $DEB..."
  349. apt-get download $DEB > /dev/null 2>&1
  350. if test $? -ne 0 ; then
  351. echo "failed, exiting..."
  352. exit 1
  353. fi
  354. echo "done"
  355. done
  356. # INSTALL DEVUAN NETWORK-MANAGER
  357. # or set it to manually installed so that it will not be autoremoved later.
  358. # ORDER MATTERS!
  359. if test $INSTALL_NM_GNOME -eq 1 ; then
  360. echo "Installing network-manager-gnome"
  361. dpkg -i --force-all ./network-manager-gnome*.deb > /dev/null 2>&1
  362. fi
  363. if test $INSTALL_NM -eq 1 ; then
  364. echo "Installing libnm0"
  365. dpkg -i --force-all ./libnm0*.deb > /dev/null 2>&1
  366. echo "Installing network-manager"
  367. dpkg -i --force-all ./network-manager_*.deb > /dev/null 2>&1
  368. fi
  369. # REMOVE SOME SYSTEMD RELATED PACKAGES THAT GET IN THE WAY
  370. # Don't remove fonts-quicksand ,breaks desktop-base
  371. REMOVE_LIST="\
  372. dbus-user-session \
  373. $IIO_SENSORS_PROXY \
  374. libnss-systemd \
  375. libpam-systemd \
  376. plymouth-label \
  377. plymouth \
  378. $LIBPLYMOUTH \
  379. udev \
  380. libudev1 \
  381. $SYSTEMD_TIMESYNCD"
  382. for DEB in $REMOVE_LIST
  383. do
  384. echo "Removing $DEB"
  385. dpkg --purge --force-all $DEB > /dev/null 2>&1
  386. done
  387. # DETECT LIBSYSTEMD AND SAVE A COPY TO KEEP APT and SYSTEMCTL HAPPY
  388. LIBSYSTEMD=$(dpkg -L libsystemd0 | grep ".so.0.")
  389. echo "Saving a copy of "$LIBSYSTEMD""
  390. cp "$LIBSYSTEMD" "$LIBSYSTEMD".bak
  391. # BEGIN TO REMOVE SYSTEMD
  392. echo "Removing systemd-sysv"
  393. dpkg --purge --force-all systemd-sysv > /dev/null 2>&1
  394. # Don't remove it here we need it to reboot the box
  395. #dpkg --purge --force-all systemd
  396. echo "Removing libsystemd0"
  397. dpkg --purge --force-all libsystemd0 > /dev/null 2>&1
  398. # RESTORE LIBSYSTEMD
  399. cp "$LIBSYSTEMD".bak "$LIBSYSTEMD"
  400. # ORDER MATTERS!
  401. DEVUAN_LIST="\
  402. libeudev1 \
  403. util-linux \
  404. libelogind0 \
  405. elogind \
  406. libpam-elogind \
  407. eudev \
  408. insserv \
  409. startpar \
  410. sysv-rc \
  411. initscripts \
  412. sysvinit-core \
  413. init"
  414. if test $INSTALL_DBUS -eq 1 ; then
  415. DEVUAN_LIST="$DEVUAN_LIST dbus dbus-x11 libdbus"
  416. fi
  417. if test $INSTALL_DEBIAN_PULSEAUDIO_CONFIG_OVERRIDE -eq 1 ; then
  418. DEVUAN_LIST="$DEVUAN_LIST debian-pulseaudio-config-override"
  419. fi
  420. # FORCE INSTALL DEVUAN PACKAGES TO BE SURE
  421. for DEBNAME in $DEVUAN_LIST
  422. do
  423. echo "Installing $DEBNAME"
  424. dpkg -i --force-all ./$DEBNAME*.deb > /dev/null 2>&1
  425. done
  426. # CLEANUP
  427. CLEANUP_LIST="$DEVUAN_LIST"
  428. if test $INSTALL_NM_GNOME -eq 1 ; then
  429. CLEANUP_LIST="$CLEANUP_LIST network-manager-gnome"
  430. fi
  431. if test $INSTALL_NM -eq 1 ; then
  432. CLEANUP_LIST="$CLEANUP_LIST libnm0 network-manager_"
  433. fi
  434. for DEBNAME in $CLEANUP_LIST
  435. do
  436. echo "Deleting downloaded package: $DEBNAME"
  437. rm -f $DEBNAME*.deb
  438. done
  439. # CHECK FOR INITTAB AND INSTALL IF MISSING
  440. echo -n "Checking for existence of /etc/inittab: "
  441. if test -f /etc/inittab ; then
  442. echo "found"
  443. else
  444. echo "not found"
  445. echo "Copying /usr/share/sysvinit/inittab to /etc/inittab"
  446. cp /usr/share/sysvinit/inittab /etc/inittab
  447. fi
  448. # INSTRUCTIONS FOR STAGE 2
  449. INFOTMP=$(mktemp Info-XXXXXXXX.txt)
  450. { echo "********************************************************************************"; \
  451. echo "* After reboot remove references to debian $VERSION_CODENAME from /etc/apt/sources.list$PAD*" ; \
  452. echo "* and run the stage 2 script in a root shell: *" ; \
  453. echo "$PWD/migration-stage2.sh" ; \
  454. if test $LXQT -eq 1 -o $LXDE -eq 1 ; then
  455. echo "* Reconfigure your /etc/network/interfaces file to use old-fashion network *" ; \
  456. echo "* names e.g. eth0 or wlan0 (or add net.ifnames=1 to grub command line), *" ; \
  457. echo "* you will be prompted to do it now if you like. *" ; \
  458. fi
  459. if test $LXQT -eq 1; then
  460. echo "* and also check your connman-ui preferences *" ; \
  461. fi
  462. if test "x$VERSION_ID" = "x11" -a $LXDE -eq 1; then
  463. echo "* and also check your connman-ui preferences *" ; \
  464. elif test "x$VERSION_ID" = "x10" -a $LXDE -eq 1 ; then
  465. echo "* and also check and reconfigure your wicd preferences *" ; \
  466. fi
  467. echo "********************************************************************************" ; } | tee "$PWD/$INFOTMP"
  468. echo "You can find these instructions in the file: $PWD/$INFOTMP"
  469. echo "#!/bin/sh" > $PWD/migration-stage2.sh
  470. echo "echo \"Setting PATH=$PATH:/usr/sbin:/sbin\"" >> $PWD/migration-stage2.sh
  471. echo "export PATH=\$PATH:/usr/sbin:/sbin" >> $PWD/migration-stage2.sh
  472. echo "echo \"Removing saved copy of $LIBSYSTEMD\"" >> $PWD/migration-stage2.sh
  473. echo "rm -f $LIBSYSTEMD" >> $PWD/migration-stage2.sh
  474. echo "dpkg --purge --force-all systemd" >> $PWD/migration-stage2.sh
  475. echo "apt install --reinstall elogind" >> $PWD/migration-stage2.sh
  476. echo "echo \"Setting date and time with ntpdate-debian\"" >> $PWD/migration-stage2.sh
  477. echo "ntpdate-debian pool.ntp.org" >> $PWD/migration-stage2.sh
  478. echo "apt update" >> $PWD/migration-stage2.sh
  479. # TODO add -y here?
  480. echo "apt upgrade" >> $PWD/migration-stage2.sh
  481. echo "apt dist-upgrade" >> $PWD/migration-stage2.sh
  482. # Don't run apt autoremove --purge or we risk deleting some conf files
  483. # from packages we erroneously removed
  484. echo "apt autoremove" >> $PWD/migration-stage2.sh
  485. echo "apt remove ntpdate" >> $PWD/migration-stage2.sh
  486. echo "echo \"Hit Enter to reboot\"" >> $PWD/migration-stage2.sh
  487. echo "read -r DUMMY" >> $PWD/migration-stage2.sh
  488. echo "reboot" >> $PWD/migration-stage2.sh
  489. chmod 766 "$PWD/migration-stage2.sh"
  490. chmod 666 "$PWD/$INFOTMP"
  491. if test $LXQT -eq 1 -o $LXDE -eq 1 ; then
  492. # WAIT FOR USER TO READ
  493. echo "Hit Enter to continue"
  494. read -r DUMMY
  495. echo "Do you want to edit /etc/network/interfaces now? [y|n]"
  496. read -r ANS
  497. if test "x$ANS" = "xy" -o "x$ANS" = "xY"; then
  498. cp /etc/network/interfaces /etc/network/interfaces.bak
  499. nano /etc/network/interfaces
  500. fi
  501. fi
  502. # DONE
  503. echo "You can reboot now"
  504. # CLEANUP
  505. rm -f /etc/apt/preferences.d/"$DEVUAN_CODENAME"