Skip to content

Instantly share code, notes, and snippets.

@riipandi
Last active October 1, 2015 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riipandi/2019196 to your computer and use it in GitHub Desktop.
Save riipandi/2019196 to your computer and use it in GitHub Desktop.
Setup Modem SMART ZTE
#!/bin/sh
# Written by Aris S Ripandi (riespandi@gmail.com
# 2012/01/16
# http://www.hex-a.blogspot.com/2012/12/cara-setting-modem-smart-freen-ce682-di.html
# cek user dulu (harus root)
[[ $(id -u) -ne 0 ]] && { echo "$0: You must be root user to run this script. Run it as 'sudo $0'"; exit 1; }
function setup() {
lsusb
eject /dev/sr0
rmmod usb_storage
read -p "Pencet enter untuk lanjut atau CTRL+C untuk keluar.." continue
lsusb
read -p "Pencet enter untuk lanjut atau CTRL+C untuk keluar.." continue
modprobe usbserial vendor=0x19d2 product=0xffdd
mv /etc/wvdial.conf /etc/wvdial.conf.bak
echo "[Dialer smart]" >> /etc/wvdial.conf
echo "Init1 = ATZ" >> /etc/wvdial.conf
echo "Init2 = ATQ0 V1 E1 S0=0 &C1 &D2" >> /etc/wvdial.conf
echo "+FCLASS =0" >> /etc/wvdial.conf
echo "Stupid Mode = 1" >> /etc/wvdial.conf
echo "Modem Type = Analog Modem" >> /etc/wvdial.conf
echo "Command Line = ATDT" >> /etc/wvdial.conf
echo "ISDN = 0" >> /etc/wvdial.conf
echo "New PPPD = yes" >> /etc/wvdial.conf
echo "Phone = #777" >> /etc/wvdial.conf
echo "Modem = /dev/ttyUSB0" >> /etc/wvdial.conf
echo "Username = smart" >> /etc/wvdial.conf
echo "Password = smart" >> /etc/wvdial.conf
echo "Baud = 460800" >> /etc/wvdial.conf
read -p "Alhamdulillah instalasi beres. Silahkan tulis perintah \"sudo wvdial smart\" untuk memulai koneksi" continue
}
function konek() {
eject /dev/sr0
sleep 2
modprobe usbserial vendor=0x19d2 product=0xffdd
sleep 2
wvdial smart
}
read -p "Pilih mana [ instal | konek ] ? " tanya
shopt -s nocasematch
if [[ $tanya =~ instal ]]; then
setup;
else
konek;
fi
shopt -u nocasematch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment