forked from AdrianDC/advanced_development_shell_tools
/
android_helpers.rc
executable file
·40 lines (35 loc) · 1.18 KB
/
android_helpers.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# ======================================
# Developed by Adrian DC - 2015-2016
# ======================================
# === Notifications ===
function pushb()
{
# PushBullet API Credentials
export PushBulletToken="token";
export PushBulletUser="user";
export PushBulletNoteUrl="url";
# Create ~/.bash_android.pushbullet.rc with the exports to override the credentials
if [ -f ~/.bash_android.pushbullet.rc ]; then
source ~/.bash_android.pushbullet.rc;
fi;
# PushBullet notification message
if [ ! -z "$1" ]; then
PushBulletComment="$1";
PushBulletNoteUrl="";
else
PushBulletComment="Done";
fi;
# PushBullet notification upload
curl --header "Access-Token: $PushBulletToken" \
--header "Content-Type: application/json" \
--data-binary "{\"body\":\"$PushBulletComment\",\"title\":\"\",\"type\":\"note\", \
\"url\":\"$PushBulletNoteUrl\",\"created\":\"$(date +%s)\", \
\"active\":\"true\",\"sender_name\":\"$PushBulletUser\"}" \
--request POST https://api.pushbullet.com/v2/pushes >/dev/null;
}
# === CleanRAM ===
function cleanram()
{
"$bash_android_dir/run_cleanram.sh";
}