2015-10-04 14:37:11 +00:00
#! /bin/bash
2015-10-30 12:26:43 +00:00
# vim: set tabstop=4 shiftwidth=4 expandtab filetype=sh:
2015-10-04 09:26:20 +00:00
alias a2server-help="more /usr/local/etc/a2server-help.txt"
2015-11-09 14:40:44 +00:00
alias a2server-setup="wget -q -O /tmp/a2server-setup ${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}$([[ "$A2SERVER_SCRIPT_URL" == */ ]] || echo -n "/")setup/ || { echo \"Can't download A2SERVER setup scripts. Do you has internet?\"; false; } && source /tmp/a2server-setup"
2015-10-04 09:26:20 +00:00
alias a2server-version="cat /usr/local/etc/A2SERVER-version"
2015-11-09 14:40:44 +00:00
alias a2server-update="wget -q -O /tmp/a2server-update ${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}$([[ "$A2SERVER_SCRIPT_URL" == */ ]] || echo -n "/")update/ || { echo \"Can't download A2SERVER setup scripts. Do you has internet?\"; false; } && source /tmp/a2server-update"
2015-10-04 09:26:20 +00:00
alias system-shutdown='sudo shutdown -h now'
alias system-restart='sudo shutdown -r now'
alias raspi-config='[[ -f /usr/bin/raspi-config ]] && sudo /usr/bin/raspi-config || echo "raspi-config not found. Are you using a Raspberry Pi with Raspbian?"'
alias raspbian-update='wget -qO /tmp/raspbian-update ivanx.com/a2server/files/raspbian-update.txt; source /tmp/raspbian-update'
alias rasppleii-update='raspbian-update a2cloud a2server'
2015-11-17 13:36:22 +00:00
alias welcome-message-edit='sudo nano /etc/motd'
2015-10-04 09:26:20 +00:00
alias showip='ifconfig eth0 | grep "inet\ addr" | cut -d: -f2 | cut -d" " -f1'
alias showmac='ifconfig eth0 | grep "HWaddr" | cut -dH -f2 | cut -c7-23'
alias showip-wifi='ifconfig wlan0 | grep "inet\ addr" | cut -d: -f2 | cut -d" " -f1'
alias showmac-wifi='ifconfig wlan0 | grep "HWaddr" | cut -dH -f2 | cut -c7-23'
alias ifreset='sudo rm /etc/udev/rules.d/70-persistent-net.rules; echo Interfaces removed. You should system-restart now.'
alias netatalk-stop="sudo /etc/init.d/netatalk stop; bonjour-off"
2015-12-18 05:45:01 +00:00
alias netatalk-start="sudo /etc/init.d/netatalk start; bonjour-on; grep -q 'ATALKD_RUN=yes' /etc/default/netatalk"
alias netatalk-restart="sudo /etc/init.d/netatalk restart; bonjour-on; grep -q 'ATALKD_RUN=yes' /etc/default/netatalk"
2015-10-04 09:26:20 +00:00
alias netatalk-off='sudo /etc/init.d/netatalk stop; bonjour-off; sudo update-rc.d -f netatalk remove &> /dev/null'
alias netatalk-on='sudo update-rc.d netatalk defaults &> /dev/null; bonjour-on; sudo /etc/init.d/netatalk restart'
alias bonjour-off="sudo mv /etc/avahi/services/afpd.service /etc/avahi/services/afpd.service_disabled &> /dev/null"
alias bonjour-on="sudo mv /etc/avahi/services/afpd.service_disabled /etc/avahi/services/afpd.service &> /dev/null"
alias netatalk-router-on='sudo sed -i '"'"'s/^eth0.*$/eth0 -router -phase 2 -net 1 -zone "A2SERVER"/'"'"' /usr/local/etc/netatalk/atalkd.conf; sudo sed -i '"'"'s/^wlan0.*$/wlan0 -router -phase 2 -net 1 -zone "A2SERVER"/'"'"' /usr/local/etc/netatalk/atalkd.conf; netatalk-restart'
alias netatalk-router-off='sudo sed -i '"'"'s/^eth0.*$/eth0/'"'"' /usr/local/etc/netatalk/atalkd.conf; sudo sed -i '"'"'s/^wlan0.*$/wlan0/'"'"' /usr/local/etc/netatalk/atalkd.conf; netatalk-restart'
alias netatalk-eth='sudo sed -i 's/^wlan0/eth0/' /usr/local/etc/netatalk/atalkd.conf; netatalk-restart'
alias netatalk-wifi='sudo sed -i 's/^eth0/wlan0/' /usr/local/etc/netatalk/atalkd.conf; netatalk-restart'
2015-12-18 05:45:01 +00:00
alias appletalk-off='sudo sed -i "s/ATALKD_RUN=yes/ATALKD_RUN=no/" /etc/default/netatalk; sudo killall macipgw > /dev/null; /etc/init.d/netatalk restart'
2015-12-20 05:40:28 +00:00
alias appletalk-on='sudo sed -i "s/ATALKD_RUN=no/ATALKD_RUN=yes/" /etc/default/netatalk; sudo /etc/init.d/netatalk restart'
2015-10-04 09:26:20 +00:00
NETATALK="/usr/local/etc/netatalk"
2015-12-10 01:39:09 +00:00
A2FILES="/srv/A2SERVER/A2FILES"
GSFILES="/srv/A2SERVER/GSFILES"
2015-10-04 09:26:20 +00:00
alias netboot-gsos="mkatinit -gs -d -f"
alias netboot-gsos-guest="mkatinit -gs -d -f guest"
alias netboot-p8="mkatinit -d -f"
alias netboot-p8-guest="mkatinit -d -f guest"
alias guest-off="sudo sed -i 's/uams_guest.so,//' /usr/local/etc/netatalk/afpd.conf; [[ -f /etc/samba/smb.conf ]] && sudo sed -i 's/^ guest ok = yes/ guest ok = no/' /etc/samba/smb.conf; sudo /etc/init.d/netatalk restart"
alias guest-on="sudo sed -i 's/-uamlist uams_clrtxt.so/-uamlist uams_guest.so,uams_clrtxt.so/' /usr/local/etc/netatalk/afpd.conf; [[ -f /etc/samba/smb.conf ]] && sudo sed -i 's/^ guest ok = no/ guest ok = yes/' /etc/samba/smb.conf; sudo /etc/init.d/netatalk restart"
2015-11-17 13:36:22 +00:00
alias samba-off='sudo /etc/init.d/samba stop; sudo update-rc.d -f samba remove &> /dev/null'
alias samba-on='sudo update-rc.d samba defaults &> /dev/null; sudo /etc/init.d/samba restart'
alias samba-stop='sudo /etc/init.d/samba stop'
alias samba-start='sudo /etc/init.d/samba start'
alias samba-restart='sudo /etc/init.d/samba restart'
2015-10-04 09:26:20 +00:00
2015-12-10 01:39:09 +00:00
alias a2files-share="sudo sed -i 's/^#share2/\/srv\/A2SERVER\/A2FILES\ A2FILES options:prodos ea:ad/' /usr/local/etc/netatalk/AppleVolumes.default; [[ -d /srv/A2SERVER/A2FILES ]] || mkdir /srv/A2SERVER/A2FILES"
alias a2files-unshare="sudo sed -i 's/^\/srv\/A2SERVER\/A2FILES.*$/#share2/' /usr/local/etc/netatalk/AppleVolumes.default"
2015-10-04 09:26:20 +00:00
alias showalias="alias | cut -d= -f 1 | cut -d' ' -f2 | more"
2015-11-09 14:40:44 +00:00
#