【发布时间】:2015-03-29 05:17:42
【问题描述】:
所以,我希望它从我的计算机上下载一个文件,将其传输到我的 iPhone,在那里安装文件,然后重新启动我的手机。出于某种原因,您在标题中看到的错误会弹出。如果有人能帮忙就好了,谢谢。
#!/bin/bash
clear
cd downloads
if [ ! -d ".tmpdl" ]; then
mkdir ".tmpdl"
fi
cd .tmpdl
echo "Enter .deb link:"
read dllink
echo "Enter name of tweak (simple):"
read name
echo "Enter IP of device:"
read IP
echo "Enter your SSH password. If you don't know what this is enter 'alpine' without the apostrophes."
read pass
echo "Sending test file..."
touch test.txt
sshpass -p "$pass" scp test.txt root@"$IP":/var/mobile/Documents
echo "If the transfer was successful (no permission denied error) enter yes or no if it wasn't."
read reply1
if [ $reply1 == no ]; then
echo "Error, wrong credentials, try again."
exit
fi
echo "Okay, attempting to download file..."
curl -o "$name".deb "$dllink"
if [ ! -d "tmp" ]; then
sshpass -p "$pass" ssh root@"$IP" << EOF
cd /
cd var/mobile/Documents
mkdir tmp
EOF
fi
sshpass -p "$pass" scp "$name".deb root@192.168.1.104:/var/mobile/Documents/tmp
echo "Sent file, deleting it from here..."
cd ..
rm -rf .tmpdl
sshpass -p "$pass" ssh root@"$IP" << EOF
cd /
cd var/mobile/Documents
mkdir tmp
mv "$name".deb tmp/
cd tmp
dpkg -i "$name".deb
echo "Clearing caches..."
cd ..
rm -rf tmp
echo "Done installing, respringing now..."
killall backboardd
EOF
【问题讨论】: