thank you @nachoparker. I think i understand the cause. But i have little experience in coding etc.
So, i did the following.
i have createt a file (“letsencrpt.sh”) in the tmp directory on the pi und put your snippet in it. than i startet it with
sudo sh /tmp/letsencrypt.sh
the result looks like this:
/tmp/letsencrypt.sh: 1: /tmp/letsencrypt.sh: source: not found
: not foundcrypt.sh: 2: /tmp/letsencrypt.sh:
/tmp/letsencrypt.sh: 3: /tmp/letsencrypt.sh: [[: not found
: not foundcrypt.sh: 3: /tmp/letsencrypt.sh: {
: not foundcrypt.sh: 4: /tmp/letsencrypt.sh:
/tmp/letsencrypt.sh: 5: /tmp/letsencrypt.sh: [[: not found
/tmp/letsencrypt.sh: 6: /tmp/letsencrypt.sh: [[: not found
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package letsencrypt
E: Command line option ’
’ [from -y
] is not understood in combination with the other options.
/tmp/letsencrypt.sh: 10: /tmp/letsencrypt.sh: install_app: not found
/tmp/letsencrypt.sh: 11: /tmp/letsencrypt.sh: [[: not found
/tmp/letsencrypt.sh: 12: /tmp/letsencrypt.sh: [[: not found
: not foundcrypt.sh: 12: /tmp/letsencrypt.sh:
/tmp/letsencrypt.sh: 14: /tmp/letsencrypt.sh: [[: not found
/tmp/letsencrypt.sh: 15: /tmp/letsencrypt.sh: [[: not found
/tmp/letsencrypt.sh: 16: /tmp/letsencrypt.sh: Syntax error: “}” unexpected
cp: cannot stat ‘/etc/letsencrypt-old/archive’: No such file or directory
I made a mistake, sorry. this is the output of the code snippet:
Riepilogo
pi@nextcloudpi:/tmp $ sudo sh -x letsencrpt.sh
+ source /usr/local/etc/library.sh
letsencrpt.sh: 1: letsencrpt.sh: source: not found
+ [[ -f /etc/letsencrypt/certbot-auto ]]
letsencrpt.sh: 3: letsencrpt.sh: [[: not found
+ [[ -f /.docker-image ]]
letsencrpt.sh: 5: letsencrpt.sh: [[: not found
+ [[ -f /.docker-image ]]
letsencrpt.sh: 6: letsencrpt.sh: [[: not found
+ mv /etc/letsencrypt /etc/letsencrypt-old
+ rm -f /etc/letsencrypt
+ apt-get remove -y letsencrypt
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
certbot python3-acme python3-certbot python3-configargparse python3-configobj python3-josepy python3-mock python3-parsedatetime python3-pbr
python3-requests-toolbelt python3-rfc3339 python3-tz python3-zope.component python3-zope.event python3-zope.hookable python3-zope.interface
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
letsencrypt
0 upgraded, 0 newly installed, 1 to remove and 39 not upgraded.
After this operation, 30.7 kB disk space will be freed.
(Reading database ... 42721 files and directories currently installed.)
Removing letsencrypt (0.28.0-1~deb9u1) ...
+ apt-get autoremove -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
certbot python3-acme python3-certbot python3-configargparse python3-configobj python3-josepy python3-mock python3-parsedatetime python3-pbr
python3-requests-toolbelt python3-rfc3339 python3-tz python3-zope.component python3-zope.event python3-zope.hookable python3-zope.interface
0 upgraded, 0 newly installed, 16 to remove and 39 not upgraded.
After this operation, 4,158 kB disk space will be freed.
(Reading database ... 42717 files and directories currently installed.)
Removing certbot (0.28.0-1~deb9u1) ...
Warning: Stopping certbot.service, but it can still be activated by:
certbot.timer
Removing python3-certbot (0.28.0-1~deb9u1) ...
Removing python3-acme (0.28.0-1~deb9u1) ...
Removing python3-configargparse (0.11.0-1) ...
Removing python3-configobj (5.0.6-2) ...
Removing python3-josepy (1.1.0-2~deb9u1) ...
Removing python3-mock (2.0.0-3) ...
Removing python3-parsedatetime (2.1-3+deb9u1) ...
Removing python3-pbr (1.10.0-1) ...
Removing python3-requests-toolbelt (0.7.0-1) ...
Removing python3-rfc3339 (1.0-4) ...
Removing python3-tz (2016.7-0.3) ...
Removing python3-zope.component (4.3.0-1) ...
Removing python3-zope.event (4.2.0-1) ...
Removing python3-zope.hookable (4.0.4-4+b1) ...
Removing python3-zope.interface (4.3.2-1) ...
Processing triggers for man-db (2.7.6.1-2) ...
+ install_app letsencrypt
letsencrpt.sh: 10: letsencrpt.sh: install_app: not found
+ [[ -f /etc/letsencrypt-old/live ]]
letsencrpt.sh: 11: letsencrpt.sh: [[: not found
+
+ [[ -f /.docker-image ]]
+ letsencrpt.sh: 14: letsencrpt.sh: [[: not found
+ [[ -f /etc/cron.weekly/letsencrypt-ncp ]]
[[ -d /etc/letsencrypt/archive ]]
letsencrpt.sh: 15: letsencrpt.sh: [[: not found
letsencrpt.sh: 12: letsencrpt.sh: [[: not found
+ cp -ravT /etc/letsencrypt-old/archive /etc/letsencrypt/archive
cp: cannot stat '/etc/letsencrypt-old/archive': No such file or directory