Loading src/install.sh +14 −10 Original line number Diff line number Diff line Loading @@ -13,23 +13,27 @@ else fi FN="boot.pat" if [ -d "/$FN" ]; then error "The file /$FN does not exist, please make sure that you mapped it to a valid path!" && exit 65 DIR=$(find / -maxdepth 1 -type d -iname "$FN" | head -n 1) [ ! -d "$DIR" ] && DIR=$(find "$STORAGE" -maxdepth 1 -type d -iname "$FN" | head -n 1) if [ -d "$DIR" ]; then BASE="DSM_VirtualDSM" && URL="file://$DIR" if [[ ! -s "$STORAGE/$BASE.boot.img" ]] || [[ ! -s "$STORAGE/$BASE.system.img" ]]; then error "The bind $DIR maps to a file that does not exist!" && exit 65 fi fi FILE=$(find / -maxdepth 1 -type f -iname "$FN" | head -n 1) [ ! -s "$FILE" ] && FILE=$(find "$STORAGE" -maxdepth 1 -type f -iname "$FN" | head -n 1) [ -s "$FILE" ] && BASE="DSM_VirtualDSM" && URL="file://$FILE" if [ -n "$URL" ]; then if [ ! -s "$FILE" ]; then if [ -n "$URL" ] && [ ! -s "$FILE" ] && [ ! -d "$DIR" ]; then BASE=$(basename "$URL" .pat) if [ ! -s "$STORAGE/$BASE.system.img" ]; then BASE=$(basename "${URL%%\?*}" .pat) : "${BASE//+/ }"; printf -v BASE '%b' "${_//%/\\x}" BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g') fi fi if [[ "${URL,,}" != "http"* ]] && [[ "${URL,,}" != "file:"* ]] ; then [ ! -s "$STORAGE/$BASE.pat" ] && error "Invalid URL: $URL" && exit 65 URL="file://$STORAGE/$BASE.pat" Loading Loading
src/install.sh +14 −10 Original line number Diff line number Diff line Loading @@ -13,23 +13,27 @@ else fi FN="boot.pat" if [ -d "/$FN" ]; then error "The file /$FN does not exist, please make sure that you mapped it to a valid path!" && exit 65 DIR=$(find / -maxdepth 1 -type d -iname "$FN" | head -n 1) [ ! -d "$DIR" ] && DIR=$(find "$STORAGE" -maxdepth 1 -type d -iname "$FN" | head -n 1) if [ -d "$DIR" ]; then BASE="DSM_VirtualDSM" && URL="file://$DIR" if [[ ! -s "$STORAGE/$BASE.boot.img" ]] || [[ ! -s "$STORAGE/$BASE.system.img" ]]; then error "The bind $DIR maps to a file that does not exist!" && exit 65 fi fi FILE=$(find / -maxdepth 1 -type f -iname "$FN" | head -n 1) [ ! -s "$FILE" ] && FILE=$(find "$STORAGE" -maxdepth 1 -type f -iname "$FN" | head -n 1) [ -s "$FILE" ] && BASE="DSM_VirtualDSM" && URL="file://$FILE" if [ -n "$URL" ]; then if [ ! -s "$FILE" ]; then if [ -n "$URL" ] && [ ! -s "$FILE" ] && [ ! -d "$DIR" ]; then BASE=$(basename "$URL" .pat) if [ ! -s "$STORAGE/$BASE.system.img" ]; then BASE=$(basename "${URL%%\?*}" .pat) : "${BASE//+/ }"; printf -v BASE '%b' "${_//%/\\x}" BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g') fi fi if [[ "${URL,,}" != "http"* ]] && [[ "${URL,,}" != "file:"* ]] ; then [ ! -s "$STORAGE/$BASE.pat" ] && error "Invalid URL: $URL" && exit 65 URL="file://$STORAGE/$BASE.pat" Loading