Skip to content

Instantly share code, notes, and snippets.

@liruqi
Last active May 14, 2020 02:47
Show Gist options
  • Save liruqi/cf7e0ebe311246b2e30ce1a9ccede60c to your computer and use it in GitHub Desktop.
Save liruqi/cf7e0ebe311246b2e30ce1a9ccede60c to your computer and use it in GitHub Desktop.
x-wrt
# https://github.com/x-wrt/x-wrt.github.io/tree/master/docs/install-on-vps
# Aliyun install script
if [ ! -f /root/x-wrt.img.gz ]; then
wget -O /root/x-wrt.img.gz --no-check-certificate https://downloads.x-wrt.com/rom/x-wrt-8.0-b202005101652-x86-64-generic-ext4-combined.img.gz
sed -i "s/errors\=remount-ro/ro/g" /etc/fstab
reboot
fi
vda1=`df -h|awk '{ if ($6 == "/") print $1 }'`
# TODO: check if /dev/shm/ exists...
(zcat /root/x-wrt.img.gz; echo open=443,network=dhcp) >/dev/shm/x-wrt.img
cat /dev/shm/x-wrt.img > $vda1 && reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment