1
1
#! /bin/bash
2
2
# Author of the script : powen
3
3
4
+ # Get Arch
5
+ ARCH=$( uname -m)
6
+ NETMUXD_AVAILABLE_ARCHS=(" x86_64" )
7
+ NETMUXD_IS_AVAILABLE=0
8
+ NETMUXD_IS_ON=0
9
+
4
10
# Check source and permission
5
11
cd " $( dirname " $0 " ) " || exit
6
12
echo " Checking source"
13
+ if [[ ! -e " AltServer" ]]; then
14
+ curl -L https://github.com/NyaMisty/AltServer-Linux/releases/download/v0.0.5/AltServer-" $ARCH " > AltServer
15
+ fi
7
16
if [[ ! -e " AltStore.ipa" ]]; then
8
- curl -L https://cdn.altstore.io/file/altstore/apps/altstore/1_4_9 .ipa > AltStore.ipa
17
+ curl -L https://cdn.altstore.io/file/altstore/apps/altstore/1_5_1 .ipa > AltStore.ipa
9
18
fi
10
19
if [[ ! -e " main" ]]; then
11
20
wget https://github.com/powenn/AltServer-Linux-ShellScript/raw/main/main
12
21
fi
22
+ if [[ ! -e " netmuxd" && ${NETMUXD_AVAILABLE_ARCHS[*]} =~ ${ARCH} ]]; then
23
+ curl -L https://github.com/jkcoxson/netmuxd/releases/download/v0.1.2/netmuxd-" $ARCH " > netmuxd
24
+ fi
13
25
if [[ ! -e " ipa" ]]; then
14
26
mkdir ipa
15
27
fi
22
34
if [[ " stat AltServer | grep -- '-rw-r--r--'" != " " ]] ; then
23
35
chmod +x AltServer
24
36
fi
37
+ if [[ " stat netmuxd | grep -- '-rw-r--r--'" != " " ]] ; then
38
+ chmod +x netmuxd
39
+ fi
25
40
26
41
# Version
27
42
LocalVersion=$( sed -n 1p version)
@@ -42,8 +57,10 @@ OPTIONS
42
57
43
58
i, --Install AltStore or ipa files
44
59
Install AltStore or ipa files to your device
45
- d, --Restart Daemon mode
46
- Restart Daemon mode to refresh apps or AltStore
60
+ w, --Switch to wifi Daemode mode (Default using it after launch)
61
+ Switch and restart to wifi Daemode mode to refresh apps or AltStore
62
+ t, --Switch to usb tethered Daemode mode
63
+ Switch and restart to usb tethered Daemode mode to refresh apps or AltStore
47
64
e, --Exit
48
65
Exit script
49
66
h, --Help
89
106
}
90
107
91
108
# Start script
92
- AltServerIcon
109
+
110
+ # AltServerIcon
93
111
HELP
94
112
UpdateNotification
113
+ if [[ ${NETMUXD_AVAILABLE_ARCHS[*]} =~ ${ARCH} ]]; then
114
+ NETMUXD_IS_AVAILABLE=1
115
+ sudo -b -S ./netmuxd
116
+ fi
95
117
96
118
./AltServer & > /dev/null &
97
119
@@ -102,23 +124,45 @@ while [ $RunScript = 0 ] ; do
102
124
case " $option " in
103
125
104
126
i|--Install-AltStore-or-ipa-files )
127
+ export " NETMUXD_IS_ON" =$NETMUXD_IS_ON
105
128
./main
106
129
;;
107
- d|--Restart-Daemon-mode )
130
+ w|--Switch-to-wifi-Daemon-mode )
131
+ if [[ $NETMUXD_IS_AVAILABLE == 1 ]]; then
132
+ killall AltServer
133
+ sudo killall netmuxd
134
+ NETMUXD_IS_ON=1
135
+ for job in ` jobs -p`
136
+ do
137
+ wait $job
138
+ done
139
+ sudo -b -S ./netmuxd
140
+ ./AltServer & > /dev/null &
141
+ else
142
+ echo " wifi-Daemon-mode is not available for your architecture"
143
+ fi
144
+ ;;
145
+ t|--Switch-to-usb-tethered-Daemode-mode )
108
146
killall AltServer
147
+ if [[ $NETMUXD_IS_AVAILABLE == 1 ]]; then
148
+ sudo killall netmuxd
149
+ NETMUXD_IS_ON=0
150
+ fi
109
151
for job in ` jobs -p`
110
152
do
111
153
wait $job
112
154
done
113
-
114
155
./AltServer & > /dev/null &
115
156
;;
116
157
e|--Exit )
117
158
killall AltServer
159
+ if [[ $NETMUXD_IS_AVAILABLE == 1 ]]; then
160
+ sudo killall netmuxd
161
+ fi
118
162
exit
119
163
;;
120
164
h|--Help )
121
- AltServerIcon
165
+ # AltServerIcon
122
166
HELP
123
167
UpdateNotification
124
168
;;
0 commit comments