Skip to content

Commit

Permalink
Fix ctrl file write function
Browse files Browse the repository at this point in the history
  • Loading branch information
VR-25 committed Jul 29, 2022
1 parent 3b96bae commit 04bf46f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions install/misc-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,12 @@ write() {
local i=y
local f=$dataDir/logs/write.log
blacklisted=false
eval set -- "$@"
if [ -f "$2" ] && chown 0:0 $2 && chmod 0644 $2; then
case "$(grep -E "^(#$2|$2)$" $f 2>/dev/null || :)" in
\#*) blacklisted=true;;
*/*) printf %s "$1" > $2 || i=x;;
*/*) eval "echo $1 > $2" || i=x;;
*) echo \#$2 >> $f
printf %s "$1" > $2 || i=x
eval "echo $1 > $2" || i=x
sed -i "s|^#$2$|$2|" $f;;
esac
else
Expand Down

0 comments on commit 04bf46f

Please sign in to comment.