run iproxy as sudo on linux

This commit is contained in:
Nebula committed 2022-09-29 13:16:59 -04:00
1 parent 7f67026950
commit ed880e751d
1 file changed
+7 -2
+7 -2
View File
@@ -284,7 +284,12 @@ if [ ! -f blobs/"$deviceid"-"$version".shsh2 ]; then
# Execute the commands once the rd is booted
_usb_fix
"$dir"/iproxy 2222 22 &> /dev/null >> "$out" &
if [ ! "$os" = 'Linux' ]; then
sudo "$dir"/iproxy 2222 22 &> /dev/null >> "$out" &
else
"$dir"/iproxy 2222 22 &> /dev/null >> "$out" &
fi
if ! ("$dir"/sshpass -p 'alpine' ssh -o StrictHostKeyChecking=no -p2222 root@localhost "echo connected" &> /dev/null > "$out"); then
echo "[*] Waiting for the ramdisk to finish booting"
fi
@@ -323,7 +328,7 @@ if [ ! -f blobs/"$deviceid"-"$version".shsh2 ]; then
sleep 2
"$dir"/sshpass -p 'alpine' ssh -o StrictHostKeyChecking=no -p2222 root@localhost "/sbin/reboot" > "$out"
sleep 1
killall iproxy
_kill_if_running iproxy
_wait normal
sleep 2