Initial commit

This commit is contained in:
Alexandre CATTEAU 2022-07-24 14:40:56 +02:00
commit 46424d7f53
4 changed files with 49 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.disabled

11
README.md Normal file
View File

@ -0,0 +1,11 @@
# bashrc-cloud
Add-on for [main bashrc](https://gitea.kto.black/adminconf/rcs-general), specific to Kloud host.
### Files
* `bashrc-cloud` should be installed at `~/.bashrc-cloud`.
#### Installation
* `install.sh` script copies above files to their respective destinations.
### TODO
* RAS

7
bashrc-cloud Normal file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
# ~/.bashrc.d/bashrc-cloud
# byMasterKTO
# Set cloud aliases
alias cloud='sudo -u www-data php /var/www/nextcloud/occ'
alias cloud-update='sudo -u www-data php /var/www/nextcloud/updater/updater.phar'

30
install.sh Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env bash
run_directory=$(dirname "$0")
user=$(whoami)
if [ -f $run_directory/.disabled ]; then
echo "Installation is disabled. Exiting..."
exit 0
fi
if [[ $user != 'root' ]]; then
if [ ! -d /home/$user/.bashrc.d ]; then
echo "~/.bashrc.d does not exist. Creating it..."
mkdir /home/$user/.bashrc.d
fi
echo "Copying bashrc-cloud to extensions directory..."
cp $run_directory/bashrc-cloud /home/$user/.bashrc.d/
else
if [ ! -d /root/.bashrc.d ]; then
echo "~/.bashrc.d does not exist. Creating it..."
mkdir /root/.bashrc.d
fi
echo "Copying bashrc-cloud to extensions directory..."
cp $run_directory/bashrc-cloud /root/.bashrc.d/
fi
echo "Finished install. Exiting..."
exit 0