-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
setup_admob_credentials.sh
42 lines (31 loc) · 1.32 KB
/
setup_admob_credentials.sh
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
41
42
#!/bin/bash
# Ask the user for their name
echo "Setup AddMobId"
echo "Dev [android] AddMobId (leave empty to skip the change) ca-app-pub...."
read devReversed
echo "Dev [iOS] AddMobId (leave empty to skip the change) ca-app-pub...."
read devReversedIOS
echo "Production [android] AddMobId (leave empty to skip the change) ca-app-pub...."
read prodReversed
echo "Production [iOS] AddMobId (leave empty to skip the change) ca-app-pub...."
read prodReversedIOS
echo ====================================
echo ========== UPDATING ==========
echo ====================================
if [ -n "$devReversed" ]
then
grep --exclude=./setup_admob_credentials.sh -r -l "admob-android-id-dev" . | sort | uniq | xargs perl -e "s/admob-android-id-dev/$devReversed/" -pi
fi
if [ -n "$devReversedIOS" ]
then
grep --exclude=./setup_admob_credentials.sh -r -l "admob-ios-id-dev" . | sort | uniq | xargs perl -e "s/admob-ios-id-dev/$devReversedIOS/" -pi
fi
if [ -n "$prodReversed" ]
then
grep --exclude=./setup_admob_credentials.sh -r -l "admob-android-id-prod" . | sort | uniq | xargs perl -e "s/admob-android-id-prod/$prodReversed/" -pi
fi
if [ -n "$prodReversedIOS" ]
then
grep --exclude=./setup_admob_credentials.sh -r -l "admob-ios-id-prod" . | sort | uniq | xargs perl -e "s/admob-ios-id-prod/$prodReversedIOS/" -pi
fi
echo "All done!"