aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorziggys <ziggys@autistici.org>2018-06-10 18:16:22 -0400
committerziggys <ziggys@autistici.org>2018-06-10 18:16:22 -0400
commit7eff9f324d32590b64f91d5576ce0f981af910a8 (patch)
tree3da892cc180d29aa1b43536e094a4b111df9b0d7
parentf62927b489d27152734d01121246f32d96943c14 (diff)
downloadgc2gs-7eff9f324d32590b64f91d5576ce0f981af910a8.zip
gc2gs-7eff9f324d32590b64f91d5576ce0f981af910a8.tar
Fix syntax
-rwxr-xr-xgc2gs.sh32
1 files changed, 20 insertions, 12 deletions
diff --git a/gc2gs.sh b/gc2gs.sh
index 746b0fb..0f0de70 100755
--- a/gc2gs.sh
+++ b/gc2gs.sh
@@ -46,7 +46,8 @@ configure () {
test -f "${RCFILE}" \
&& printf "%s already exists...\\ndo you want to overwrite? " "${RCFILE}" \
- && read -p "[yes to create a new one] (yes/no): " OVERANS \
+ && printf "[yes to create a new one] (yes/no): " \
+ && read -r OVERANS \
|| echo "" > "${RCFILE}"
test "${OVERANS}" = "no" \
@@ -55,18 +56,25 @@ configure () {
|| echo "" > "${RCFILE}"
printf "\\nPlease enter your gnu-social account information\\n"
- read -p "'username' (i.e. 'me@myno.de', 'username=me'): " CONFUNAME
- read -p "'password' (your 'plain-text password'): " CONFPASS
- read -p "'node' (url w/o trainling slash 'https://myno.de'): " CONFNODE
+ printf "'username' (i.e. 'me@myno.de', 'username=me'): " \
+ && read -r CONFUNAME
+ printf "'password' (your 'plain-text password'): " \
+ && read -r CONFPASS
+ printf "'node' (url w/o trainling slash 'https://myno.de'): " \
+ && read -r CONFNODE
# obfuscate user and password
CONFUNAME="$(echo "$CONFUNAME" | base64 -)"
CONFPASS="$(echo "$CONFPASS" | base64 -)"
printf "\\nPlease enter your git project information\\n"
- read -p "git project (the name of your git repository): " CONFPROJ
- read -p "project url (https://git.reposito.ry/me/project): " CONFPURL
- read -p "project path (i.e. ${HOME}/git/myrepo ): " REPOPATH
- read -p "platform (cgit | gitlab | github | gitea | other): " CONFPLAT
+ printf "git project (the name of your git repository): " \
+ && read -r CONFPROJ
+ printf "project url (https://git.reposito.ry/me/project): " \
+ && read -r CONFPURL
+ printf "project path (i.e. %s/git/myrepo ): " "${HOME}" \
+ && read -r REPOPATH
+ printf "platform (cgit | gitlab | github | gitea | other): " \
+ && read -r CONFPLAT
printf "\\nPopulating %s...\\n" "${RCFILE}"
printf "USER=%s;\\nPASSWORD=%s;\\nNODE=%s;\\n" \
@@ -77,8 +85,8 @@ configure () {
# this file stores passwords, securize permissions
chmod 600 "${RCFILE}"
- printf "\\ndo you want to configure an automatic 'pre-push' 'git hook'? "
- read -p "(yes/no): " HOOKANS
+ printf "\\ndo you want to configure a 'pre-push' 'git hook'? (yes/no): " \
+ && read -r HOOKANS
test "${HOOKANS}" = "no" \
&& printf "done!\\n" \
&& exit $? \
@@ -120,8 +128,8 @@ test ! -f "${RCFILE}" \
&& printf "It seems you don't have a configuration file for %s\\n" \
"${CONFNAME}" \
&& printf "Do you want to configure it know? " \
- && printf "(answering 'no' will exit script) " \
- && read -p "(yes/no): " ANSFORCONFIG \
+ && printf "(answering 'no' will exit script) (yes/no): " \
+ && read -r ANSFORCONFIG \
|| echo "RCFILE exists" > /dev/null
test "${ANSFORCONFIG}" = "yes" && configure || exit 0