Compare commits
2 Commits
master
...
uberspace7
| Author | SHA1 | Date | |
|---|---|---|---|
|
868d131972
|
|||
|
81fc921e3f
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
.htaccess
|
||||
.htpasswd
|
||||
config.cfg
|
||||
quota
|
||||
|
||||
10
README.md
10
README.md
@@ -26,8 +26,16 @@ It's recommended to install UAAP automatically by using another script of mine,
|
||||
### Manual method (not recommended, needs more work)
|
||||
|
||||
Download the git repository by using
|
||||
`git clone http://src.mehl.mx/git/uberspace-setup.git`
|
||||
`git clone http://src.mehl.mx/git/uberspace-webadmin.git`
|
||||
|
||||
I assume it's best to place these files in a subdomain. I used `panel.example.com` for that.
|
||||
|
||||
Now open the files `config.cfg.sample`, `.htaccess.sample`, and `.htpasswd.sample` and change all necessary settings. Be sure to remove the `.sample` in the file names of these files afterwards.
|
||||
|
||||
### Other steps
|
||||
|
||||
On Uberspace 7, you'll need to create a cronjob to provide quota information because of SELinux limitations. To do so, edit your crontab with `crontab -e` and insert:
|
||||
|
||||
```
|
||||
* * * * * quota -gsl > /var/www/virtual/MYUSERNAME/panel.example.com/quota
|
||||
```
|
||||
|
||||
@@ -347,11 +347,11 @@ if [ "$ACTION" == "quota" ]; then
|
||||
echo "Calculating account disk usage..."
|
||||
echo
|
||||
|
||||
USAGE=$(quota -gsl | tail -n 1 | awk -F" " '{ print $2 }')
|
||||
QUOTA=$(quota -gsl | tail -n 1 | awk -F" " '{ print $3 }' | sed 's/[A-Za-z]//g')
|
||||
USAGE=$(cat quota | tail -n 1 | awk -F" " '{ print $2 }')
|
||||
QUOTA=$(cat quota | tail -n 1 | awk -F" " '{ print $3 }' | sed 's/[A-Za-z]//g')
|
||||
|
||||
# If smaller than 1M, set usage to 1M to avoid miscalcuations
|
||||
if [ $(echo $USAGE | grep -q "[A-Za-z]$" ; echo $?) != 0 ]; then
|
||||
if ! echo $USAGE | grep -q "[A-Za-z]$"; then
|
||||
USAGE="1"
|
||||
else
|
||||
USAGE=$(echo $USAGE | sed 's/[A-Za-z]//g')
|
||||
@@ -364,7 +364,7 @@ if [ "$ACTION" == "quota" ]; then
|
||||
|
||||
PERC=$(echo "scale=2; 100 - $PERC" | bc)
|
||||
|
||||
echo "You have "$[$QUOTA - $USAGE]" MB free ($PERC %)."
|
||||
echo "You have "$(($QUOTA - $USAGE))" MB free ($PERC %)."
|
||||
|
||||
fi # /quota
|
||||
|
||||
|
||||
Reference in New Issue
Block a user