0

I am installing DUC (Dynamic update client) for NO-IP DDNS on Ubuntu 20.04 desktop.

I used help from this site : https://www.blackmoreops.com/2020/11/18/how-to-install-the-noip2-on-ubuntu-and-run-via-systemd-systemctl-noip-dynamic-update-client/

I got stuck when I need to do this:

root@ubuntu:/usr/local/src/noip-2.1.9-1# vi /etc/init.d/noip2.sh

Paste the following in the file and save it:

#######################################################
#! /bin/sh
# . /etc/rc.d/init.d/functions # uncomment/modify for your killproc
case "$1" in
start)
echo "Starting noip2."
/usr/local/bin/noip2
;;
stop)
echo -n "Shutting down noip2."
killproc -TERM /usr/local/bin/noip2
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
#######################################################
  1. I do not know if I need to copy ########## at the beginning and end or just everything between those characters.

  2. I can't save it or exit (it is not Ctrl+S to save or Ctrl+X to exit or F2 to exit)

  3. I think that I have a few files in folder etc/int.d that are not needed or they are duplicated:

    .noip2.sh.swl
    .noip2.sh.swm
    .noip2.sh.swn
    .noip2.sh.swo
    

I do not know how to remove them if necessary.

BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
DavorT
  • 1
  • 1
  • Does this answer your question? [How do I save files edited with vim?](https://askubuntu.com/questions/252760/how-do-i-save-files-edited-with-vim) – muru Nov 07 '21 at 18:55
  • And https://askubuntu.com/questions/1301119/what-are-swp-files-and-why-are-they-created – muru Nov 07 '21 at 18:56
  • Does this answer your question? [Can't save .bashrc file in VIM ("The swap file ".bashrc.swp" already exists!")](https://askubuntu.com/questions/736182/cant-save-bashrc-file-in-vim-the-swap-file-bashrc-swp-already-exists) – karel Nov 08 '21 at 05:31
  • Cannot you use `sudo apt install nano` and the `nano /path/to/file` or you can use `gedit /path/to/file` , VI isn't necessary , it is just a text editor like gedit and nano, And also ### doesn't mean anything – Error404 Nov 08 '21 at 09:47

1 Answers1

1

The # means whatever follows it will be a comment, so whether you include those lines or not makes no difference.

vi doesn't use ctrl+s to save. To write the buffer to disk and quit press escape followed by :wq (short for write and quit). Here are some other ways to exit vi(m).

As for the files, they are temporary files created by vi and will go away when you close the editor.

frippe
  • 573
  • 3
  • 13