[script] use grep -E instead of egrep

This commit is contained in:
Mathieu Maret 2022-09-22 15:50:12 +02:00
parent e6b9d84f02
commit afbcf99932

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
nb_bk=$(sudo ls /var/lib/gitea/ | egrep ".*dump.*.zip" |wc -l) nb_bk=$(sudo ls /var/lib/gitea/ | grep -E ".*dump.*.zip" |wc -l)
if [ $nb_bk != 0 ]; then if [ $nb_bk != 0 ]; then
echo "EXISTING GITEA BACKUP!" echo "EXISTING GITEA BACKUP!"
@ -9,7 +9,7 @@ fi
sudo -u gitea sh -c "cd ~gitea; gitea dump -c /etc/gitea/app.ini > /dev/null 2>&1" sudo -u gitea sh -c "cd ~gitea; gitea dump -c /etc/gitea/app.ini > /dev/null 2>&1"
backup_file=$(sudo ls /var/lib/gitea/ | egrep ".*dump.*.zip") backup_file=$(sudo ls /var/lib/gitea/ | grep -E ".*dump.*.zip")
backup_file="/var/lib/gitea/"$backup_file backup_file="/var/lib/gitea/"$backup_file
sudo mv $backup_file /tmp/ sudo mv $backup_file /tmp/
backup_file="/tmp/$(basename $backup_file)" backup_file="/tmp/$(basename $backup_file)"