-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround for wtfos-system wrongly including busybox
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#/bin/sh | ||
|
||
#this script checks for a bad files list for the wtfos-system package | ||
#if it includes busybox we get into trouble when updating | ||
#and we can't fix this for existing installs with an update because of that | ||
|
||
#this health check cheats and autofixes the problem without user confirmation | ||
#if we don't they are liable to proceed to updating (which don't block on health checks) | ||
|
||
check () { | ||
#if system.img is not mounted | ||
if [ -f /opt/lib/opkg/info/wtfos-system.list ] && grep -q "busybox" /opt/lib/opkg/info/wtfos-system.list; then | ||
fix | ||
fi | ||
} | ||
|
||
fix () { | ||
busybox sed -i '\/blackbox\/wtfos\/opt\/bin\/busybox/d' /opt/lib/opkg/info/wtfos-system.list | ||
} | ||
|
||
#run the check | ||
check | ||
result=$? | ||
if [ $result -ne 0 ]; then | ||
#if the exit code wasn't zero | ||
if [[ "$1" == "fix" ]]; then | ||
#if the first arg is "fix" proceed to fix | ||
fix | ||
exit $? | ||
else | ||
#otherwise exit with the check results | ||
exit $result | ||
fi | ||
fi |