mirror of
https://github.com/PirateBox-Dev/PirateBoxScripts_Webserver.git
synced 2023-12-14 07:22:58 +01:00
delete_empty.sh: Don't clean out root filesystem if shared folder does not exist
As OpenWrt still needs a more verbose script then a simple find command, we need to stick at this. The script now exits if the target directory does not exist. Also we try to reduce the amount of files checked in the while clause with reducing the find output to regular files only. Closed: #133
This commit is contained in:
parent
28f1cd0153
commit
27b8474e52
1 changed files with 7 additions and 2 deletions
|
@ -1,12 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
# This script is needed for Piratebox on OpenWrt.
|
||||
# The find utility there has only a limited feature set.
|
||||
|
||||
IFS='
|
||||
'
|
||||
|
||||
|
||||
# Change directory, if not exist exit to not cleanup the
|
||||
# OS filesystem.
|
||||
cd $1 || exit 1
|
||||
|
||||
cd $1
|
||||
ls_list=$( find ./ )
|
||||
ls_list=$( find ./ -type f )
|
||||
|
||||
for filename in $ls_list
|
||||
do
|
||||
|
|
Loading…
Reference in a new issue