Skip to content

Commit 2da3877

Browse files
add upgrade function
1 parent 07ff048 commit 2da3877

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

scripts/udroid/udroid.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ _reset() {
146146
fi
147147
}
148148

149-
_remove() {
149+
remove() {
150150
case $1 in
151151
mate) SUITE="mate";;
152152
xfce|xfce4) SUITE="xfce4" ;;
@@ -162,6 +162,23 @@ _remove() {
162162
fi
163163
}
164164

165+
upgrade() {
166+
url_host="https://raw.githubusercontent.com"
167+
url_org="/RandomCoderOrg"
168+
repo="/fs-manager-udroid"
169+
170+
if [ -n "$OVERRIDE_BRANCH" ]; then
171+
BRANCH=$OVERRIDE_BRANCH
172+
else
173+
BRANCH="main"
174+
fi
175+
176+
path="/$BRANCH/scripts/udroid/udroid.sh"
177+
url="$url_host$url_org$repo$path"
178+
179+
download "$TERMUX/usr/bin/udroid" "$url"
180+
}
181+
165182
is_installed() {
166183
target_suite=$1
167184

@@ -195,6 +212,7 @@ if [ $# -ge 0 ]; then
195212
-i|--install) shift;_install $1 ;;
196213
-re|--reset) shift ; _reset $1 ;;
197214
-r|--remove) shift ; _remove $1 ;;
215+
-S|--sync|--upgrade) upgrade ;;
198216
*) l_login $*;;
199217
esac
200218
fi

0 commit comments

Comments
 (0)