Skip to content

Commit

Permalink
auto check if 'twit' command exists
Browse files Browse the repository at this point in the history
  • Loading branch information
gojigeje committed Mar 4, 2015
1 parent 0257d54 commit ab96d96
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tweet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ua="Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
# change directory to script's directory
DIR="$( cd "$( dirname "$0" )" && pwd )"
cd "$DIR"
#rm temp/*_output

setup() {
mkdir -p temp
Expand All @@ -21,6 +20,21 @@ setup() {
menit=$(date +%M)
aksi_array=()

# check if twit command exists
if [ ! -f /usr/bin/twit ]; then
echo "[tweet.sh] command 'twit' tidak ditemukan! buat link di '/usr/bin/twit'"
ln -s "$DIR/twit.py" "/usr/bin/twit" > /dev/null 2>&1
# success?
if [ ! -f /usr/bin/twit ]; then
echo "[tweet.sh] ERROR: gagal membuat link ke '/usr/bin/twit' !"
echo "[tweet.sh] periksa permission atau buat link secara manual"
exit
else
echo "[tweet.sh] SUKSES: link command 'twit' berhasil dibuat"
echo ""
fi
fi

# load plugin
for f in plugin/*; do
. $f
Expand Down
Empty file modified twit.py
100644 → 100755
Empty file.

0 comments on commit ab96d96

Please sign in to comment.