Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mod/hakchi/rootfs/etc/preinit')
-rw-r--r--mod/hakchi/rootfs/etc/preinit15
1 files changed, 7 insertions, 8 deletions
diff --git a/mod/hakchi/rootfs/etc/preinit b/mod/hakchi/rootfs/etc/preinit
index 99ec8f1..8d2bb64 100644
--- a/mod/hakchi/rootfs/etc/preinit
+++ b/mod/hakchi/rootfs/etc/preinit
@@ -4,16 +4,16 @@ rand(){
source_parts(){
[ -z "$temppath" ] && local temppath=/tmp
+ mkdir -p "$temppath"
local script=$temppath/script_$(rand)
rm -f "$script"
- for i in $(find $(dirname "$1") -maxdepth 1 -path "$1" | sort); do
+ local searchpath=$(dirname "$1")
+ [ -d "$searchpath" ] || return 1
+ for i in $(find "$searchpath" -maxdepth 1 -path "$1" | sort); do
cat "$i" >> "$script"
done
- guard_ud(){
- dos2unix -u "$1"
- source "$1"
- }
- guard_ud "$script"
+ dos2unix -u "$script"
+ source "$script"
local ret=$?
rm -f "$script"
return $ret
@@ -53,8 +53,7 @@ script_init(){
}
preinit(){
- mkdir -p /tmp
- [ -z "$gamepath" ] && [ -d "/newroot" ] && /bin/busybox --install -s /bin/ && cp $rootfs/bin/rsync /bin
+ [ -z "$gamepath" ] && [ -d "/newroot" ] && /bin/busybox --install -s /bin/ && cp -a $rootfs/bin/rsync /bin/
source_base
source_parts "$preinitpath/p????_*"
}