2020-06-01 19:23:30 +02:00
|
|
|
#!/bin/bash
|
2015-12-28 01:53:30 +01:00
|
|
|
|
|
|
|
if [ "$#" != "0" ]; then
|
2017-01-03 23:21:43 +01:00
|
|
|
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
|
|
|
|
|
2020-06-01 19:23:30 +02:00
|
|
|
if [ -d "@TERMUX_HOME@/storage" ]; then
|
|
|
|
echo
|
|
|
|
echo "Directory '~/storage' is going to be wiped. No storage contents will be touched."
|
|
|
|
read -re -p "Do you want to continue ? (y/n) " CHOICE
|
|
|
|
|
|
|
|
if ! [[ "${CHOICE}" =~ (Y|y) ]]; then
|
|
|
|
echo "Leaving intact the contents of '~/storage' directory."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-04-11 02:20:17 +02:00
|
|
|
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
|