termux-packages/packages/termux-tools/termux-setup-storage

30 lines
782 B
Plaintext
Raw Normal View History

#!/bin/bash
2015-12-28 01:53:30 +01:00
if [ "$#" != "0" ]; then
echo 'usage: termux-setup-storage'
echo 'Use without arguments to ensure storage permission granted'
echo 'and symlinks to storage available in $HOME/storage'
exit
2015-12-28 01:53:30 +01:00
fi
if [ -d "@TERMUX_HOME@/storage" ]; then
cat <<- EOF
It appears that directory '~/storage' already exists.
This script is going to rebuild its structure from
scratch, wiping all dangling files. The actual storage
content IS NOT going to be deleted.
EOF
read -re -p "Do you want to continue? (y/n) " CHOICE
if ! [[ "${CHOICE}" =~ (Y|y) ]]; then
echo "Aborting configuration and leaving directory '~/storage' intact."
exit 1
fi
fi
am broadcast --user 0 \
2015-12-28 01:53:30 +01:00
--es com.termux.app.reload_style storage \
-a com.termux.app.reload_style com.termux > /dev/null