Initial commit
This commit is contained in:
commit
46424d7f53
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.disabled
|
11
README.md
Normal file
11
README.md
Normal 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
7
bashrc-cloud
Normal 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
30
install.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user