Skip to content
This repository was archived by the owner on Sep 7, 2023. It is now read-only.

Commit 65f4b55

Browse files
committed
Add update notification
1 parent 644f278 commit 65f4b55

10 files changed

Lines changed: 85 additions & 17 deletions

File tree

AltServer-aarch64/run.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ fi
2121
HasExistAccount=$(cat saved.txt)
2222
UDID=$(lsusb -v 2> /dev/null | grep -e "Apple Inc" -A 2 | grep iSerial | awk '{print $3}')
2323
HasExistipa=$(ls ipa)
24+
LocalVersion=$(sed -n 1p version)
25+
LatestVersion=$(curl -Lsk 'https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/version')
2426

2527

2628
# Instruction
@@ -148,9 +150,21 @@ SaveAcccount() {
148150
esac
149151
}
150152

153+
# Show update avaliable message
154+
UpdateNotification() {
155+
if [[ $LatestVersion > $LocalVersion ]] ; then
156+
cat << EOF
157+
158+
-------<< UPDATE AVALIABLE >>-------
159+
160+
EOF
161+
fi
162+
}
163+
151164
# Start script
152165
AltServerIcon
153166
cat help.txt
167+
UpdateNotification
154168
echo "Please connect to your device and press Enter to continue"
155169
read key
156170
idevicepair pair > /dev/null

AltServer-aarch64/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
0.2.1
1+
0.2.2
22
aarch64

AltServer-armv7/run.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ fi
2121
HasExistAccount=$(cat saved.txt)
2222
UDID=$(lsusb -v 2> /dev/null | grep -e "Apple Inc" -A 2 | grep iSerial | awk '{print $3}')
2323
HasExistipa=$(ls ipa)
24+
LocalVersion=$(sed -n 1p version)
25+
LatestVersion=$(curl -Lsk 'https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/version')
2426

2527

2628
# Instruction
@@ -148,9 +150,21 @@ SaveAcccount() {
148150
esac
149151
}
150152

153+
# Show update avaliable message
154+
UpdateNotification() {
155+
if [[ $LatestVersion > $LocalVersion ]] ; then
156+
cat << EOF
157+
158+
-------<< UPDATE AVALIABLE >>-------
159+
160+
EOF
161+
fi
162+
}
163+
151164
# Start script
152165
AltServerIcon
153166
cat help.txt
167+
UpdateNotification
154168
echo "Please connect to your device and press Enter to continue"
155169
read key
156170
idevicepair pair > /dev/null

AltServer-armv7/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
0.2.1
1+
0.2.2
22
armv7

AltServer-x64/run.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ fi
2424
HasExistAccount=$(cat saved.txt)
2525
UDID=$(lsusb -v 2> /dev/null | grep -e "Apple Inc" -A 2 | grep iSerial | awk '{print $3}')
2626
HasExistipa=$(ls ipa)
27+
LocalVersion=$(sed -n 1p version)
28+
LatestVersion=$(curl -Lsk 'https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/version')
2729

2830

2931
# Instruction
@@ -151,9 +153,21 @@ SaveAcccount() {
151153
esac
152154
}
153155

156+
# Show update avaliable message
157+
UpdateNotification() {
158+
if [[ $LatestVersion > $LocalVersion ]] ; then
159+
cat << EOF
160+
161+
-------<< UPDATE AVALIABLE >>-------
162+
163+
EOF
164+
fi
165+
}
166+
154167
# Start script
155168
AltServerIcon
156169
cat help.txt
170+
UpdateNotification
157171
echo "Please connect to your device and press Enter to continue"
158172
read key
159173
idevicepair pair > /dev/null

AltServer-x64/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
0.2.1
1+
0.2.2
22
x64

Test/run.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ fi
2121
HasExistAccount=$(cat saved.txt)
2222
UDID=$(lsusb -v 2> /dev/null | grep -e "Apple Inc" -A 2 | grep iSerial | awk '{print $3}')
2323
HasExistipa=$(ls ipa)
24+
LocalVersion=$(sed -n 1p version)
25+
LatestVersion=$(curl -Lsk 'https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/version')
2426

2527

2628
# Instruction
@@ -148,9 +150,21 @@ SaveAcccount() {
148150
esac
149151
}
150152

153+
# Show update avaliable message
154+
UpdateNotification() {
155+
if [[ $LatestVersion > $LocalVersion ]] ; then
156+
cat << EOF
157+
158+
-------<< UPDATE AVALIABLE >>-------
159+
160+
EOF
161+
fi
162+
}
163+
151164
# Start script
152165
AltServerIcon
153166
cat help.txt
167+
UpdateNotification
154168
echo "Please connect to your device and press Enter to continue"
155169
read key
156170
idevicepair pair > /dev/null

Test/update.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,21 @@ LocalVersion=$(sed -n 1p version)
66
LatestVersion=$(curl -Lsk 'https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/version')
77
Arch=$(sed -n 2p version)
88
DIR=$(pwd)
9-
if [[ $LatestVersion != $LocalVersion ]] ; then
9+
if [[ $LatestVersion > $LocalVersion ]] ; then
1010
rm -rf AltStore.ipa
1111
wget https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/AltStore.ipa
1212
wget https://github.com/powenn/AltServer-Linux-ShellScript/releases/download/$LatestVersion/AltServer-$Arch.zip
1313
unzip -o AltServer-$Arch.zip
1414
cp -R ./AltServer-$Arch/* $DIR
1515
rm -rf AltServer-$Arch.zip AltServer-$Arch
1616
echo "Done"
17-
elif [[ $LatestVersion = $LocalVersion ]] ; then
18-
echo "you are using the latest release"
19-
fi
20-
2117
cat << EOF
2218
2319
What updated in version $LatestVersion ?
2420
Script:
25-
- Added update option
26-
- daemon mode improved
21+
- Added update notification
22+
- Improved update option
2723
EOF
24+
elif [[ $LatestVersion = $LocalVersion ]] ; then
25+
echo "you are using the latest release"
26+
fi

run.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ fi
2121
HasExistAccount=$(cat saved.txt)
2222
UDID=$(lsusb -v 2> /dev/null | grep -e "Apple Inc" -A 2 | grep iSerial | awk '{print $3}')
2323
HasExistipa=$(ls ipa)
24+
LocalVersion=$(sed -n 1p version)
25+
LatestVersion=$(curl -Lsk 'https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/version')
2426

2527

2628
# Instruction
@@ -148,9 +150,21 @@ SaveAcccount() {
148150
esac
149151
}
150152

153+
# Show update avaliable message
154+
UpdateNotification() {
155+
if [[ $LatestVersion > $LocalVersion ]] ; then
156+
cat << EOF
157+
158+
-------<< UPDATE AVALIABLE >>-------
159+
160+
EOF
161+
fi
162+
}
163+
151164
# Start script
152165
AltServerIcon
153166
cat help.txt
167+
UpdateNotification
154168
echo "Please connect to your device and press Enter to continue"
155169
read key
156170
idevicepair pair > /dev/null

update.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,21 @@ LocalVersion=$(sed -n 1p version)
66
LatestVersion=$(curl -Lsk 'https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/version')
77
Arch=$(sed -n 2p version)
88
DIR=$(pwd)
9-
if [[ $LatestVersion != $LocalVersion ]] ; then
9+
if [[ $LatestVersion > $LocalVersion ]] ; then
1010
rm -rf AltStore.ipa
1111
wget https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/AltStore.ipa
1212
wget https://github.com/powenn/AltServer-Linux-ShellScript/releases/download/$LatestVersion/AltServer-$Arch.zip
1313
unzip -o AltServer-$Arch.zip
1414
cp -R ./AltServer-$Arch/* $DIR
1515
rm -rf AltServer-$Arch.zip AltServer-$Arch
1616
echo "Done"
17-
elif [[ $LatestVersion = $LocalVersion ]] ; then
18-
echo "you are using the latest release"
19-
fi
20-
2117
cat << EOF
2218
2319
What updated in version $LatestVersion ?
2420
Script:
25-
- Added update option
26-
- daemon mode improved
21+
- Added update notification
22+
- Improved update option
2723
EOF
24+
elif [[ $LatestVersion = $LocalVersion ]] ; then
25+
echo "you are using the latest release"
26+
fi

0 commit comments

Comments
 (0)