fix: added --no-confirm to arch update
This commit is contained in:
1 parent
d2b11f7e5c
commit
496fe13c7f
3 files changed
+45
-46
No files matched your search
@@ -5,10 +5,10 @@
|
|||||||
alias mount_all='sudo $HOME/.config/fish/scripts/mount.sh'
|
alias mount_all='sudo $HOME/.config/fish/scripts/mount.sh'
|
||||||
alias umount_all='sudo $HOME/.config/fish/scripts/umount.sh'
|
alias umount_all='sudo $HOME/.config/fish/scripts/umount.sh'
|
||||||
|
|
||||||
function mkdir
|
# function mkdir
|
||||||
command mkdir $argv
|
# command mkdir $argv
|
||||||
and cd -- $argv[-1]
|
# and cd -- $argv[-1]
|
||||||
end
|
# end
|
||||||
|
|
||||||
################ COMMON ALIASES ################################################
|
################ COMMON ALIASES ################################################
|
||||||
|
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ function updateall
|
|||||||
echo "Pending pacman updates:"
|
echo "Pending pacman updates:"
|
||||||
printf "%s\n" $qu_output
|
printf "%s\n" $qu_output
|
||||||
end
|
end
|
||||||
sudo pacman -Syu
|
sudo pacman -Syu --noconfirm
|
||||||
set -l pacman_code $status
|
set -l pacman_code $status
|
||||||
if test $pacman_code -eq 0
|
if test $pacman_code -eq 0
|
||||||
set pacman_status "updated"
|
set pacman_status "updated"
|
||||||
|
|||||||
+40
-41
@@ -9,69 +9,68 @@ mount_cifs() {
|
|||||||
# Create mount point if missing
|
# Create mount point if missing
|
||||||
if [ ! -d "$mount_point" ]; then
|
if [ ! -d "$mount_point" ]; then
|
||||||
echo "Creating mount point: $mount_point"
|
echo "Creating mount point: $mount_point"
|
||||||
sudo mkdir -p "$mount_point || { echo 'Mount point creation failed'; exit 1; }"
|
sudo mkdir -p "$mount_point" || { echo "Mount point creation failed for $mount_point"; return 1; }
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Mounting $source to $mount_point with options: $options"
|
echo "Mounting $source to $mount_point with options: $options"
|
||||||
sudo mount -t cifs -o "$options" "$source" "$mount_point" || {
|
if ! sudo mount -t cifs -o "$options" "$source" "$mount_point"; then
|
||||||
echo "Mount failed for $source. Check credentials and network."
|
echo "Mount failed for $source. Check credentials and network."
|
||||||
exit 1
|
return 1
|
||||||
}
|
fi
|
||||||
echo "Successfully mounted: $mount_point"
|
echo "Successfully mounted: $mount_point"
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_mounted() {
|
is_mounted() {
|
||||||
mountpoint -q "$1"
|
mountpoint -q "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Mount FRITZ.NAS (from fstab line 1)
|
# --- Mount FRITZ.NAS ---
|
||||||
if ! is_mounted "/home/honney/mount/fritzNAS"; then
|
if ! is_mounted "/home/honney/mount/fritzNAS"; then
|
||||||
if ping -c 1 -W 1 "192.168.1.1" >/dev/null 2>&1; then
|
if ping -c 1 -W 1 "192.168.1.1" >/dev/null 2>&1; then
|
||||||
mount_cifs "//192.168.1.1/FRITZ.NAS" \
|
mount_cifs "//192.168.1.1/FRITZ.NAS" \
|
||||||
"/home/honney/mount/fritzNAS" \
|
"/home/honney/mount/fritzNAS" \
|
||||||
"credentials=/home/honney/.cred/samba_credentials,uid=1000,gid=1000,vers=3.0,cache=none,nounix,noserverino,file_mode=0755,dir_mode=0755"
|
"credentials=/home/honney/.cred/samba_credentials,uid=1000,gid=1000,vers=3.0,cache=none,nounix,noserverino,file_mode=0755,dir_mode=0755" \
|
||||||
fi
|
|| echo "WARNING: FRITZ.NAS mount failed, continuing..."
|
||||||
fi
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
mount_points=("/home/honney/mount/Data" "/home/honney/mount/Media" "/home/honney/mount/Ripping" "/home/honney/mount/Apps")
|
|
||||||
|
|
||||||
if ping -c 1 -W 1 "192.168.188.122" >/dev/null 2>&1; then
|
|
||||||
echo "192.168.188.122, mounting shares..."
|
|
||||||
echo ""
|
|
||||||
mounts=("//192.168.188.122/Data" "//192.168.188.122/Media" "//192.168.188.122/Ripping" "//192.168.188.122/Apps")
|
|
||||||
for i in "${!mounts[@]}"; do
|
|
||||||
mount="${mounts[$i]}"
|
|
||||||
mount_point="${mount_points[$i]}"
|
|
||||||
echo "Checking $mount_point"
|
|
||||||
if ! is_mounted "$mount_point"; then
|
|
||||||
echo "$mount_point unmounted"
|
|
||||||
mount_cifs "$mount" \
|
|
||||||
"$mount_point" \
|
|
||||||
"credentials=/home/honney/.cred/trueNAS_credentials,vers=3.1.1,iocharset=utf8,rw,uid=1000,gid=1000,nounix,noperm,file_mode=0660,dir_mode=0770,hard,intr,cache=loose"
|
|
||||||
else
|
else
|
||||||
echo "$mount_point already mounted"
|
echo "192.168.1.1 unreachable, skipping FRITZ.NAS"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
echo ""
|
|
||||||
done
|
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
mount_points=("/home/honney/mount/Data" "/home/honney/mount/Media" "/home/honney/mount/Ripping" "/home/honney/mount/Apps")
|
||||||
|
share_names=("Data" "Media" "Ripping" "Apps")
|
||||||
|
|
||||||
|
# Determine which TrueNAS host is reachable
|
||||||
|
host=""
|
||||||
|
if ping -c 1 -W 1 "192.168.188.122" >/dev/null 2>&1; then
|
||||||
|
host="192.168.188.122"
|
||||||
|
echo "192.168.188.122 reachable, mounting shares..."
|
||||||
elif ping -c 1 -W 1 "100.64.0.3" >/dev/null 2>&1; then
|
elif ping -c 1 -W 1 "100.64.0.3" >/dev/null 2>&1; then
|
||||||
|
host="100.64.0.3"
|
||||||
echo "192.168.188.122 unreachable"
|
echo "192.168.188.122 unreachable"
|
||||||
echo "100.64.0.3 reachable, mounting shares..."
|
echo "100.64.0.3 reachable, mounting shares..."
|
||||||
echo ""
|
|
||||||
mounts=("//100.64.0.3/Data" "//100.64.0.3/Media" "//100.64.0.3/Ripping" "//100.64.0.3/Apps")
|
|
||||||
for i in "${!mounts[@]}"; do
|
|
||||||
mount="${mounts[$i]}"
|
|
||||||
mount_point="${mount_points[$i]}"
|
|
||||||
echo "Checking $mount_point"
|
|
||||||
if ! is_mounted "$mount_point"; then
|
|
||||||
echo "$mount_point unmounted"
|
|
||||||
mount_cifs "$mount" \
|
|
||||||
"$mount_point" \
|
|
||||||
"credentials=/home/honney/.cred/trueNAS_credentials,vers=3.1.1,iocharset=utf8,rw,uid=1000,gid=1000,nounix,noperm,file_mode=0660,dir_mode=0770,hard,intr,cache=loose"
|
|
||||||
else
|
else
|
||||||
|
echo "Neither 192.168.188.122 nor 100.64.0.3 reachable, skipping TrueNAS mounts."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
for i in "${!mount_points[@]}"; do
|
||||||
|
mount_point="${mount_points[$i]}"
|
||||||
|
source="//${host}/${share_names[$i]}"
|
||||||
|
|
||||||
|
echo "Checking $mount_point"
|
||||||
|
if is_mounted "$mount_point"; then
|
||||||
echo "$mount_point already mounted"
|
echo "$mount_point already mounted"
|
||||||
|
else
|
||||||
|
echo "$mount_point unmounted"
|
||||||
|
mount_cifs "$source" \
|
||||||
|
"$mount_point" \
|
||||||
|
"credentials=/home/honney/.cred/trueNAS_credentials,vers=3.1.1,iocharset=utf8,rw,uid=1000,gid=1000,nounix,noperm,file_mode=0660,dir_mode=0770,hard,intr,cache=loose" \
|
||||||
|
|| echo "WARNING: $mount_point mount failed, continuing..."
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
Reference in new issue
Block a user